more CVehicle

This commit is contained in:
aap
2019-07-09 23:49:44 +02:00
parent a65dd41da7
commit 702cd00765
10 changed files with 278 additions and 30 deletions

View File

@ -2,4 +2,5 @@
#include "patcher.h"
#include "PlayerInfo.h"
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }

View File

@ -67,6 +67,7 @@ public:
RwTexture *m_pSkinTexture;
void MakePlayerSafe(bool);
void AwardMoneyForExplosion(CVehicle *vehicle);
};
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");

View File

@ -158,8 +158,12 @@ void
FixCar(void)
{
CVehicle *veh = FindPlayerVehicle();
if(veh == nil || !veh->IsCar())
if(veh == nil)
return;
veh->m_fHealth = 1000.0f;
if(!veh->IsCar())
return;
((CAutomobile*)veh)->Damage.SetEngineStatus(0);
((CAutomobile*)veh)->Fix();
}