]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/mortar.qc
Merge branch 'master' into TimePath/items
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / mortar.qc
index d804ed481bc1d772585ea671d32a4391957b5b00..951fa7078af50eb2295a8e567572aed52e9349b9 100644 (file)
@@ -334,20 +334,20 @@ 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, bool fire1, bool fire2))
+               METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int slot, 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(fire1)
+                       } else if(fire & 1)
                        {
-                               if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(mortar, refire)))
+                               if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_PRI(mortar, refire)))
                                {
                                        W_Mortar_Attack(thiswep);
-                                       weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
+                                       weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
                                }
                        }
-                       else if(fire2)
+                       else if(fire & 2)
                        {
                                if(WEP_CVAR_SEC(mortar, remote_detonateprimary))
                                {
@@ -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, true, WEP_CVAR_SEC(mortar, refire)))
+                               else if(weapon_prepareattack(thiswep, actor, slot, true, WEP_CVAR_SEC(mortar, refire)))
                                {
                                        W_Mortar_Attack2(thiswep);
-                                       weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
+                                       weapon_thinkf(actor, slot, WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
                                }
                        }
                }