[saco] Implement/match CVehicle::UpdateColor()

This commit is contained in:
RD42 2024-08-20 23:14:44 +08:00
parent ddb991e278
commit 4e78bc6599
2 changed files with 23 additions and 1 deletions

View File

@ -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;

View File

@ -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();