mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[saco] Implement/match CVehicle::GetVehicleSubtype()
* Implement/match `GetVehicleSubtypeFromVehiclePtr(...)`
This commit is contained in:
parent
6669d58ffd
commit
587e87d11d
@ -1936,5 +1936,32 @@ DWORD unnamed_100B6100(char *szString, int nMaxLen)
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT GetVehicleSubtypeFromVehiclePtr(VEHICLE_TYPE *pVehicle)
|
||||
{
|
||||
if(!pVehicle) return 0;
|
||||
if(pVehicle->entity.vtable == 0x871120) {
|
||||
return VEHICLE_SUBTYPE_CAR;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x8721A0) {
|
||||
return VEHICLE_SUBTYPE_BOAT;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x871360) {
|
||||
return VEHICLE_SUBTYPE_BIKE;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x871948) {
|
||||
return VEHICLE_SUBTYPE_PLANE;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x871680) {
|
||||
return VEHICLE_SUBTYPE_HELI;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x871528) {
|
||||
return VEHICLE_SUBTYPE_PUSHBIKE;
|
||||
}
|
||||
else if(pVehicle->entity.vtable == 0x872370) {
|
||||
return VEHICLE_SUBTYPE_TRAIN;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -70,3 +70,6 @@ BOOL IsHexChar(wchar_t c);
|
||||
DWORD GetColorFromEmbedCode(char *szString);
|
||||
DWORD GetColorFromEmbedCode(wchar_t *szString);
|
||||
void RemoveColorEmbedsFromString(char *szString);
|
||||
|
||||
UINT GetVehicleSubtypeFromVehiclePtr(VEHICLE_TYPE *pVehicle);
|
||||
|
||||
|
@ -139,6 +139,16 @@ void CVehicle::UpdateColor()
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
UINT CVehicle::GetVehicleSubtype()
|
||||
{
|
||||
if(m_pVehicle) {
|
||||
return GetVehicleSubtypeFromVehiclePtr(m_pVehicle);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
BOOL CVehicle::HasSunk()
|
||||
{
|
||||
if(!m_pVehicle) return FALSE;
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
void ResetPointers();
|
||||
|
||||
void SetLockedState(int iLocked);
|
||||
UINT GetVehicleSubtype();
|
||||
|
||||
float GetHealth();
|
||||
void SetHealth(float fHealth);
|
||||
|
Loading…
Reference in New Issue
Block a user