]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't call wr_gonethink without a weapon
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 24 Mar 2016 00:12:27 +0000 (11:12 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 24 Mar 2016 00:12:27 +0000 (11:12 +1100)
qcsrc/server/weapons/weaponsystem.qc

index 0e8ea58762020a4f780050cdacd57d11319c6d01..21279dae93b6589f9b801f892f7f5f6694272ab9 100644 (file)
@@ -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);
                        }