From fcd036595b297078de3daf1dd4fad3aaca499f8c Mon Sep 17 00:00:00 2001 From: Silent Date: Fri, 22 Apr 2016 21:55:15 +0200 Subject: [PATCH] Nicer looping in fixed bouncing panel functions --- SilentPatchSA/VehicleSA.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/SilentPatchSA/VehicleSA.cpp b/SilentPatchSA/VehicleSA.cpp index 1132dbb..5fa931b 100644 --- a/SilentPatchSA/VehicleSA.cpp +++ b/SilentPatchSA/VehicleSA.cpp @@ -113,7 +113,7 @@ bool CVehicle::CustomCarPlate_TextureCreate(CVehicleModelInfo* pModelInfo) void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo) { //CCustomCarPlateMgr::SetupPlates(reinterpret_cast(pModelInfo->pRwObject), PlateTexture, PlateDesign); - for ( int i = 0; i < NUM_MAX_PLATES; i++ ) + for ( ptrdiff_t i = 0; i < NUM_MAX_PLATES; i++ ) { if ( pModelInfo->m_apPlateMaterials[i] ) { @@ -269,11 +269,9 @@ void CPlane::Render() void CPlane::Fix_SilentPatch() { // Reset bouncing panels - for ( int i = 0; i < 3; i++ ) + // No reset on Vortex + for ( ptrdiff_t i = m_nModelIndex == 539 ? 1 : 0; i < 3; i++ ) { - // No reset on Vortex - if ( i == 0 && m_nModelIndex == 539 ) - continue; m_aBouncingPanel[i].m_nNodeIndex = -1; } } @@ -283,11 +281,9 @@ void CAutomobile::Fix_SilentPatch() ResetFrames(); // Reset bouncing panels - for ( int i = 0; i < 3; i++ ) + for ( ptrdiff_t i = (m_nModelIndex == 525 && m_pCarNode[21]) || (m_nModelIndex == 531 && m_pCarNode[17]) ? 1 : 0; i < 3; i++ ) { // Towtruck/Tractor fix - if ( i == 0 && ((m_nModelIndex == 525 && m_pCarNode[21]) || (m_nModelIndex == 531 && m_pCarNode[17])) ) - continue; m_aBouncingPanel[i].m_nNodeIndex = -1; } } @@ -298,7 +294,7 @@ void CAutomobile::ResetFrames() if ( pOrigClump ) { // Instead of setting frame rotation to (0,0,0) like R* did, obtain the original frame matrix from CBaseNodelInfo clump - for ( int i = 8; i < 25; i++ ) + for ( ptrdiff_t i = 8; i < 25; i++ ) { if ( m_pCarNode[i] ) {