]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/mortar.qc
Weapons: pass weaponentity field instead of slot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / mortar.qc
index f2e2013d8b5b14501292ca15ffb5d0ec011607c5..05092139669df071ce5069cc411e8fccc8ab68ff 100644 (file)
@@ -334,17 +334,17 @@ void W_Mortar_Attack2(Weapon thiswep)
                        wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
                        wepinfo_ter_dps = 0;
                        */
-               METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int slot, int fire))
+               METHOD(Mortar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
                        if(autocvar_g_balance_mortar_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
                                w.wr_reload(w);
                        } else if(fire & 1)
                        {
-                               if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_PRI(mortar, refire)))
+                               if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(mortar, refire)))
                                {
                                        W_Mortar_Attack(thiswep);
-                                       weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
+                                       weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
                                }
                        }
                        else if(fire & 2)
@@ -364,10 +364,10 @@ void W_Mortar_Attack2(Weapon thiswep)
                                        if(nadefound)
                                                sound(actor, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM);
                                }
-                               else if(weapon_prepareattack(thiswep, actor, slot, true, WEP_CVAR_SEC(mortar, refire)))
+                               else if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(mortar, refire)))
                                {
                                        W_Mortar_Attack2(thiswep);
-                                       weapon_thinkf(actor, slot, WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
+                                       weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
                                }
                        }
                }