[saco] Implement/match CVehicle::SetLandingGearState(...)

This commit is contained in:
RD42 2024-08-20 23:32:24 +08:00
parent 83a85fe44f
commit eb180a5c80
2 changed files with 34 additions and 0 deletions

View File

@ -247,6 +247,33 @@ void CVehicle::SetAlarmState(WORD wState)
//-----------------------------------------------------------
void CVehicle::SetLandingGearState(eLandingGearState state)
{
if(GetVehicleSubtype() != VEHICLE_SUBTYPE_PLANE) return;
DWORD dwVehiclePtr = (DWORD)m_pVehicle;
float fPlaneLandingGear = 0.0f;
_asm mov eax, dwVehiclePtr
_asm mov edx, [eax+0x9CC]
_asm mov fPlaneLandingGear, edx
if (state == LGS_DOWN && fPlaneLandingGear == 0.0f)
{
_asm mov ecx, dwVehiclePtr
_asm mov edx, 0x6CAC20
_asm call edx
}
else if(state == LGS_UP && fPlaneLandingGear == 1.0f)
{
_asm mov ecx, dwVehiclePtr
_asm mov edx, 0x6CAC70
_asm call edx
}
}
//-----------------------------------------------------------
UINT CVehicle::GetPassengersMax()
{
return 0;

View File

@ -4,6 +4,12 @@
#include "game.h"
#include "entity.h"
enum eLandingGearState
{
LGS_UP,
LGS_DOWN,
};
//-----------------------------------------------------------
class CVehicle : public CEntity
@ -54,6 +60,7 @@ public:
void SetSirenOn(BYTE byteState);
BOOL IsSirenOn();
void SetAlarmState(WORD wState);
void SetLandingGearState(eLandingGearState state);
void SetEngineState(BOOL bState);