]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/vaporizer.qc
Weapons: use bitflags for fire modes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / vaporizer.qc
index f7aceee20f3f531f0519610d3a1de5e511ad2b17..bbdeb69ac22c1577b2684d447cafb4adedfb73e2 100644 (file)
@@ -244,7 +244,7 @@ void W_RocketMinsta_Attack3 (void)
                        else
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
                }
-               METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, bool fire1, bool fire2))
+               METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, int fire))
                {
                        float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
                        // if the laser uses load, we also consider its ammo for reloading
@@ -255,7 +255,7 @@ void W_RocketMinsta_Attack3 (void)
                                Weapon w = get_weaponinfo(actor.weapon);
                                w.wr_reload(w);
                        }
-                       if(fire1 && (actor.ammo_cells || !autocvar_g_rm) && !forbidWeaponUse(actor))
+                       if((fire & 1) && (actor.ammo_cells || !autocvar_g_rm) && !forbidWeaponUse(actor))
                        {
                                if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(vaporizer, refire)))
                                {
@@ -263,7 +263,7 @@ void W_RocketMinsta_Attack3 (void)
                                        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
                                }
                        }
-                       if(fire2 || (fire1 && !actor.ammo_cells && autocvar_g_rm))
+                       if((fire & 2) || ((fire & 1) && !actor.ammo_cells && autocvar_g_rm))
                        {
                                if((autocvar_g_rm && autocvar_g_rm_laser) || autocvar_g_rm_laser == 2)
                                {