]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix wr_gonethink
authorMario <mario@smbclan.net>
Tue, 9 Aug 2016 09:46:05 +0000 (19:46 +1000)
committerMario <mario@smbclan.net>
Tue, 9 Aug 2016 09:46:05 +0000 (19:46 +1000)
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/server/weapons/weaponsystem.qc

index b2ede3c503596bc19d1a8e3c173a91ac36bc4859..3b83b450fe1b74ebe94d2971b4d7f0bd88c49843 100644 (file)
@@ -109,7 +109,7 @@ CLASS(Weapon, Object)
     /** (SERVER) called whenever a player dies */
     METHOD(Weapon, wr_playerdeath, void(Weapon this, entity actor)) {}
     /** (SERVER) logic to run when weapon is lost */
-    METHOD(Weapon, wr_gonethink, void(Weapon this, entity actor)) {}
+    METHOD(Weapon, wr_gonethink, void(Weapon this, entity actor, .entity weaponentity)) {}
     /** (ALL)    dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) */
     METHOD(Weapon, wr_config, void(Weapon this)) {}
     /** (CLIENT) weapon specific zoom reticle */
index f161823d2840ae565900539d41cb69e517000722..70335cc0e523c92bd70ef379cf44e6af5137c55a 100644 (file)
@@ -471,19 +471,13 @@ METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
         }
     }
 }
-METHOD(Hagar, wr_gonethink, void(entity thiswep, entity actor))
+METHOD(Hagar, wr_gonethink, void(entity thiswep, entity actor, .entity weaponentity))
 {
     // we lost the weapon and want to prepare switching away
     if(actor.hagar_load)
     {
-        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-       {
-               .entity weaponentity = weaponentities[slot];
-               if(actor.(weaponentity).weaponname != WEP_HAGAR.mdl)
-                       continue; // only if it's a hagar (currently only way to detect)
-               actor.(weaponentity).state = WS_READY;
-               W_Hagar_Attack2_Load_Release(actor, weaponentity);
-       }
+       actor.(weaponentity).state = WS_READY;
+       W_Hagar_Attack2_Load_Release(actor, weaponentity);
     }
 }
 METHOD(Hagar, wr_setup, void(entity thiswep, entity actor))
index 6cc1324cf478825b975aff1a2f6cde236cdbf599..1a4e797f52d3da41d3625e224e0c91983748cd87 100644 (file)
@@ -569,7 +569,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                        }
                        else if (e)
                        {
-                               e.wr_gonethink(e, actor);
+                               e.wr_gonethink(e, actor, weaponentity);
                        }
                }