CGunWeapon: Make destructor virtual

This class is used as polymorphic type, so the destructor should be
marked as virtual to prevent any potential undefined behavior.

This also more closely matches the GM8E v0 binary itself.
This commit is contained in:
Lioncash 2020-03-12 17:19:33 -04:00
parent d93df18a37
commit 2c091ac124
2 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,8 @@ CGunWeapon::CGunWeapon(CAssetId ancsId, EWeaponType type, TUniqueId playerId, EM
BuildDependencyList(x200_beamId);
}
CGunWeapon::~CGunWeapon() = default;
void CGunWeapon::AllocResPools(CPlayerState::EBeamId beam) {
const auto& wPair = g_tweakGunRes->GetWeaponPair(beam);
const char* const* muzzleNames = &skMuzzleNames[size_t(beam) * 2];

View File

@ -116,6 +116,8 @@ protected:
public:
CGunWeapon(CAssetId ancsId, EWeaponType type, TUniqueId playerId, EMaterialTypes playerMaterial,
const zeus::CVector3f& scale);
virtual ~CGunWeapon();
void AsyncLoadSuitArm(CStateManager& mgr);
virtual void Reset(CStateManager& mgr);
virtual void PlayAnim(NWeaponTypes::EGunAnimType type, bool loop);