From: Mario Date: Tue, 9 Aug 2016 09:46:05 +0000 (+1000) Subject: Fix wr_gonethink X-Git-Tag: xonotic-v0.8.2~723^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c21ce28cb332b39863c2d8ba9c6dc621bd6e4336;p=xonotic%2Fxonotic-data.pk3dir.git Fix wr_gonethink --- diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index b2ede3c50..3b83b450f 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -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 */ diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index f161823d2..70335cc0e 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -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)) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 6cc1324cf..1a4e797f5 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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); } }