diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-02 22:48:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-02 22:48:17 +0200 |
commit | 4448156e29c1c2dc6db476bbde53926efdba7331 (patch) | |
tree | 4be7e31e00dacbdfb2a6fadfd414aab0eaf64c39 /src/peds/PlayerPed.cpp | |
parent | Ceil health and armor values in hud (fix 99 health) (diff) | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
download | re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar.gz re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar.bz2 re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar.lz re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar.xz re3-4448156e29c1c2dc6db476bbde53926efdba7331.tar.zst re3-4448156e29c1c2dc6db476bbde53926efdba7331.zip |
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r-- | src/peds/PlayerPed.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index dc44983d..6d0d394d 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; @@ -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 |