changed saving compatibility

This commit is contained in:
Nikolay Korolev
2020-05-02 18:02:17 +03:00
parent 5a916c16b7
commit f372ce156d
18 changed files with 567 additions and 612 deletions

View File

@ -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);
}
}
#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

View File

@ -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);