From: Mario Date: Mon, 8 Aug 2016 11:39:12 +0000 (+1000) Subject: Unhardcode mine layer slot checks X-Git-Tag: xonotic-v0.8.2~723^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7524e9401f3aced8b6cd1644ca693eb7ee219fc;p=xonotic%2Fxonotic-data.pk3dir.git Unhardcode mine layer slot checks --- diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 2b59e7841..f58a8f254 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -131,7 +131,8 @@ void W_MineLayer_Explode(entity this, entity directhitentity) if(!w.wr_checkammo1(w, own)) { own.cnt = WEP_MINE_LAYER.m_id; - int slot = 0; // TODO: unhardcode + .entity weaponentity = this.weaponentity_fld; + int slot = weaponslot(weaponentity); ATTACK_FINISHED(own, slot) = time; PS(own).m_switchweapon = w_getbestweapon(own); } @@ -162,7 +163,8 @@ void W_MineLayer_DoRemoteExplode(entity this) if(!w.wr_checkammo1(w, own)) { own.cnt = WEP_MINE_LAYER.m_id; - int slot = 0; // TODO: unhardcode + .entity weaponentity = this.weaponentity_fld; + int slot = weaponslot(weaponentity); ATTACK_FINISHED(own, slot) = time; PS(own).m_switchweapon = w_getbestweapon(own); } @@ -338,6 +340,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity) Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); mine = WarpZone_RefSys_SpawnSameRefSys(actor); + mine.weaponentity_fld = weaponentity; IL_PUSH(g_mines, mine); mine.owner = mine.realowner = actor; if(WEP_CVAR(minelayer, detonatedelay) >= 0)