summaryrefslogtreecommitdiffstats
path: root/src/peds/PlayerPed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r--src/peds/PlayerPed.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 664fff18..c6c4824b 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -19,6 +19,13 @@
#define PAD_MOVE_TO_GAME_WORLD_MOVE 60.0f
+const uint32 CPlayerPed::nSaveStructSize =
+#ifdef COMPATIBLE_SAVES
+ 1520;
+#else
+ sizeof(CPlayerPed);
+#endif
+
CPlayerPed::~CPlayerPed()
{
delete m_pWanted;
@@ -771,7 +778,7 @@ CPlayerPed::KeepAreaAroundPlayerClear(void)
for (int i = 0; i < lastVehicle; i++) {
CVehicle *veh = (CVehicle*)vehicles[i];
if (veh->VehicleCreatedBy != MISSION_VEHICLE) {
- if (veh->m_status != STATUS_PLAYER && veh->m_status != STATUS_PLAYER_DISABLED) {
+ if (veh->GetStatus() != STATUS_PLAYER && veh->GetStatus() != STATUS_PLAYER_DISABLED) {
if ((veh->GetPosition() - playerPos).MagnitudeSqr() > 25.0f) {
veh->AutoPilot.m_nTempAction = TEMPACT_WAIT;
veh->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 5000;
@@ -1320,7 +1327,7 @@ CPlayerPed::ProcessControl(void)
case PED_ATTACK:
case PED_FIGHT:
case PED_AIM_GUN:
- if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG400)) {
+ if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) {
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) {
if (padUsed)
PlayerControl1stPersonRunAround(padUsed);
@@ -1504,3 +1511,33 @@ CPlayerPed::ProcessControl(void)
UpdateRpHAnim();
#endif
}
+
+#ifdef COMPATIBLE_SAVES
+void
+CPlayerPed::Save(uint8*& buf)
+{
+ CPed::Save(buf);
+ SkipSaveBuf(buf, 16);
+ WriteSaveBuf<float>(buf, m_fMaxStamina);
+ SkipSaveBuf(buf, 28);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[0]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[1]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[2]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[3]);
+ SkipSaveBuf(buf, 116);
+}
+
+void
+CPlayerPed::Load(uint8*& buf)
+{
+ CPed::Load(buf);
+ SkipSaveBuf(buf, 16);
+ m_fMaxStamina = ReadSaveBuf<float>(buf);
+ SkipSaveBuf(buf, 28);
+ m_nTargettableObjects[0] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[1] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[2] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[3] = ReadSaveBuf<int32>(buf);
+ SkipSaveBuf(buf, 116);
+}
+#endif