From 3a40147ce9c6396f2da52b61fe41d93cbd795aa0 Mon Sep 17 00:00:00 2001 From: Silent Date: Thu, 7 Mar 2019 18:54:21 +0100 Subject: [PATCH] Add null check to Rhino code --- SilentPatchSA/VehicleSA.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SilentPatchSA/VehicleSA.cpp b/SilentPatchSA/VehicleSA.cpp index c79a9ee..6ad3acd 100644 --- a/SilentPatchSA/VehicleSA.cpp +++ b/SilentPatchSA/VehicleSA.cpp @@ -680,11 +680,17 @@ void CAutomobile::Fix_SilentPatch() Door[REAR_LEFT_DOOR].SetExtraWheelPositions( 1.0f, 1.0f, 1.0f, 1.0f ); Door[REAR_RIGHT_DOOR].SetExtraWheelPositions( 1.0f, 1.0f, 1.0f, 1.0f ); - RwObject* object = GetFirstObject( m_pCarNode[3] ); - RpAtomicSetFlags( object, 0 ); + if ( m_pCarNode[3] != nullptr ) + { + RwObject* object = GetFirstObject( m_pCarNode[3] ); + RpAtomicSetFlags( object, 0 ); + } - object = GetFirstObject( m_pCarNode[6] ); - RpAtomicSetFlags( object, 0 ); + if ( m_pCarNode[6] != nullptr ) + { + RwObject* object = GetFirstObject( m_pCarNode[6] ); + RpAtomicSetFlags( object, 0 ); + } } }