summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-05-02 22:48:17 +0200
committerGitHub <noreply@github.com>2020-05-02 22:48:17 +0200
commit4448156e29c1c2dc6db476bbde53926efdba7331 (patch)
tree4be7e31e00dacbdfb2a6fadfd414aab0eaf64c39 /src/weapons
parentCeil health and armor values in hud (fix 99 health) (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-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 '')
-rw-r--r--src/weapons/Weapon.cpp28
-rw-r--r--src/weapons/Weapon.h5
2 files changed, 32 insertions, 1 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 9897e73f..e9b917de 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -2257,4 +2257,30 @@ bool
CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
{
return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, ignoreSeeThrough, ignoreSomeObjects);
-} \ No newline at end of file
+}
+
+#ifdef COMPATIBLE_SAVES
+void
+CWeapon::Save(uint8*& buf)
+{
+ WriteSaveBuf<uint32>(buf, m_eWeaponType);
+ WriteSaveBuf<uint32>(buf, m_eWeaponState);
+ WriteSaveBuf<uint32>(buf, m_nAmmoInClip);
+ WriteSaveBuf<uint32>(buf, m_nAmmoTotal);
+ WriteSaveBuf<uint32>(buf, m_nTimer);
+ WriteSaveBuf<bool>(buf, m_bAddRotOffset);
+ SkipSaveBuf(buf, 3);
+}
+
+void
+CWeapon::Load(uint8*& buf)
+{
+ m_eWeaponType = (eWeaponType)ReadSaveBuf<uint32>(buf);
+ m_eWeaponState = (eWeaponState)ReadSaveBuf<uint32>(buf);
+ m_nAmmoInClip = ReadSaveBuf<uint32>(buf);
+ m_nAmmoTotal = ReadSaveBuf<uint32>(buf);
+ m_nTimer = ReadSaveBuf<uint32>(buf);
+ m_bAddRotOffset = ReadSaveBuf<bool>(buf);
+ SkipSaveBuf(buf, 3);
+}
+#endif
diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h
index 2c3a9657..1b2c0320 100644
--- a/src/weapons/Weapon.h
+++ b/src/weapons/Weapon.h
@@ -67,6 +67,11 @@ public:
bool HasWeaponAmmoToBeUsed(void);
static bool ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects);
+
+#ifdef COMPATIBLE_SAVES
+ void Save(uint8*& buf);
+ void Load(uint8*& buf);
+#endif
};
VALIDATE_SIZE(CWeapon, 0x18);