Skip to content

Commit

Permalink
Fix Hornet gun recharging to full ammo after loading a save game
Browse files Browse the repository at this point in the history
Resolves #190
  • Loading branch information
SamVanheer committed Feb 2, 2023
1 parent 2f29611 commit 62b84ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Renamed `CWorld::Instance` to `CWorld::World` to avoid conflicting with `CBaseEntity::Instance` function name
* Added `-flifetime-dse=1` flag to Linux Makefile to disable compiler optimization that removed entity memory zero-initialization, resulting in the game crashing when any entity touches the world [#187](https://github.com/SamVanheer/halflife-updated/issues/187)(Thanks FreeSlave)
* Fixed game_player_equip crashing when given a null activator [#189](https://github.com/SamVanheer/halflife-updated/issues/189)
* Fixed Hornet gun recharging to full ammo after loading a save game [#190](https://github.com/SamVanheer/halflife-updated/issues/190)

### New features

Expand Down
6 changes: 6 additions & 0 deletions dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,12 @@ TYPEDESCRIPTION CEgon::m_SaveData[] =
};
IMPLEMENT_SAVERESTORE(CEgon, CBasePlayerWeapon);

TYPEDESCRIPTION CHgun::m_SaveData[] =
{
DEFINE_FIELD(CHgun, m_flRechargeTime, FIELD_TIME),
};
IMPLEMENT_SAVERESTORE(CHgun, CBasePlayerWeapon);

TYPEDESCRIPTION CSatchel::m_SaveData[] =
{
DEFINE_FIELD(CSatchel, m_chargeReady, FIELD_INTEGER),
Expand Down
6 changes: 6 additions & 0 deletions dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,12 @@ enum hgun_e
class CHgun : public CBasePlayerWeapon
{
public:
#ifndef CLIENT_DLL
bool Save(CSave& save) override;
bool Restore(CRestore& restore) override;
static TYPEDESCRIPTION m_SaveData[];
#endif

void Spawn() override;
void Precache() override;
int iItemSlot() override { return 4; }
Expand Down

0 comments on commit 62b84ba

Please sign in to comment.