From 930952e839659da78e1bdbef33b0a38532f4e495 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 24 Mar 2016 11:12:27 +1100 Subject: [PATCH] Don't call wr_gonethink without a weapon --- qcsrc/server/weapons/weaponsystem.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 0e8ea5876..21279dae9 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -417,6 +417,7 @@ bool forbidWeaponUse(entity player) void W_WeaponFrame(Player actor) { TC(Player, actor); + TC(PlayerState, PS(actor)); .entity weaponentity = weaponentities[0]; // TODO: unhardcode entity this = actor.(weaponentity); if (frametime) actor.weapon_frametime = frametime; @@ -559,11 +560,12 @@ void W_WeaponFrame(Player actor) if (!block_weapon) { Weapon e = PS(actor).m_weapon; + TC(Weapon, e); if (w != WEP_Null) { e.wr_think(e, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1)); } - else + else if (e) { e.wr_gonethink(e); } -- 2.39.2