From 4e78bc6599832d8a1465ffe8418d6a43760531e9 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:14:44 +0800 Subject: [PATCH] [saco] Implement/match `CVehicle::UpdateColor()` --- saco/game/vehicle.cpp | 17 +++++++++++++++++ saco/game/vehicle.h | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/saco/game/vehicle.cpp b/saco/game/vehicle.cpp index 0f1e868..c3b49de 100644 --- a/saco/game/vehicle.cpp +++ b/saco/game/vehicle.cpp @@ -122,6 +122,23 @@ void CVehicle::SetColor(BYTE byteColor1, BYTE byteColor2) //----------------------------------------------------------- +void CVehicle::UpdateColor() +{ + if(!m_pVehicle) return; + if(!GamePool_Vehicle_GetAt(m_dwGTAId)) return; + + if(m_bHasNewColor) { + if(!field_71) { + if(m_byteColor1 != m_pVehicle->byteColor1 || m_byteColor2 != m_pVehicle->byteColor2) { + m_pVehicle->byteColor1 = m_byteColor1; + m_pVehicle->byteColor2 = m_byteColor2; + } + } + } +} + +//----------------------------------------------------------- + BOOL CVehicle::HasSunk() { if(!m_pVehicle) return FALSE; diff --git a/saco/game/vehicle.h b/saco/game/vehicle.h index 69bd4e5..02d91d5 100644 --- a/saco/game/vehicle.h +++ b/saco/game/vehicle.h @@ -14,7 +14,11 @@ public: VEHICLE_TYPE *m_pVehicle; - char _gap50[41]; + char _gap50[33]; + + int field_71; + + char _gap75[4]; BYTE m_byteColor1; BYTE m_byteColor2; @@ -31,6 +35,7 @@ public: float GetHealth(); void SetHealth(float fHealth); void SetColor(BYTE byteColor1, BYTE byteColor2); + void UpdateColor(); BOOL HasSunk(); BOOL IsWrecked();