]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
get rid of all direct use of weapon sets
authorRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 15:55:17 +0000 (16:55 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 15:55:17 +0000 (16:55 +0100)
qcsrc/common/items.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/w_porto.qc

index 250aee11215c42100cdbc135b07d3956b5525e42..6504e1724e095f6a97ef7ec6a2f674b304c99f99 100644 (file)
@@ -90,11 +90,14 @@ void register_weapon(float id, float(float) func, float ammotype, float i, float
 void register_weapons_done();
 
 #if 1
+.float weapons;
+# define WEPSET_DECLARE_A(a) float _WS_##a
+
 # define WEPSET_CLEAR_E(e) ((e).weapons = 0)
-# define WEPSET_CLEAR_A(a) ((a) = 0)
+# define WEPSET_CLEAR_A(a) ((_WS_##a) = 0)
 
 # define WEPSET_EMPTY_E(e) ((e).weapons == 0)
-# define WEPSET_EMPTY_A(a) ((a) == 0)
+# define WEPSET_EMPTY_A(a) ((_WS_##a) == 0)
 
 # define WEPSET_COPY_EE(e,o) ((e).weapons = (o).weapons)
 # define WEPSET_EQ_EE(e,o) ((e).weapons == (o).weapons)
@@ -104,13 +107,13 @@ void register_weapons_done();
 # define WEPSET_CONTAINS_ANY_EE(e,o) ((e).weapons & (o).weapons)
 # define WEPSET_CONTAINS_ALL_EE(e,o) (((e).weapons & (o).weapons) == (e).weapons)
 
-# define WEPSET_COPY_EA(e,a) ((e).weapons = (a))
-# define WEPSET_EQ_EA(e,a) ((e).weapons == (a))
-# define WEPSET_OR_EA(e,a) ((e).weapons |= (a))
-# define WEPSET_AND_EA(e,a) ((e).weapons &= (a))
-# define WEPSET_ANDNOT_EA(e,a) ((e).weapons &~= (a))
-# define WEPSET_CONTAINS_ANY_EA(e,a) ((e).weapons & (a))
-# define WEPSET_CONTAINS_ALL_EA(e,a) (((e).weapons & (a)) == (a))
+# define WEPSET_COPY_EA(e,a) ((e).weapons = (_WS_##a))
+# define WEPSET_EQ_EA(e,a) ((e).weapons == (_WS_##a))
+# define WEPSET_OR_EA(e,a) ((e).weapons |= (_WS_##a))
+# define WEPSET_AND_EA(e,a) ((e).weapons &= (_WS_##a))
+# define WEPSET_ANDNOT_EA(e,a) ((e).weapons &~= (_WS_##a))
+# define WEPSET_CONTAINS_ANY_EA(e,a) ((e).weapons & (_WS_##a))
+# define WEPSET_CONTAINS_ALL_EA(e,a) (((e).weapons & (_WS_##a)) == (_WS_##a))
 
 # define WEPSET_COPY_EW(e,w) ((e).weapons = power2of((w) - WEP_FIRST))
 # define WEPSET_EQ_EW(e,w) ((e).weapons == power2of((w) - WEP_FIRST))
@@ -119,31 +122,31 @@ void register_weapons_done();
 # define WEPSET_ANDNOT_EW(e,w) ((e).weapons &~= power2of((w) - WEP_FIRST))
 # define WEPSET_CONTAINS_EW(e,w) ((e).weapons & power2of((w) - WEP_FIRST))
 
-# define WEPSET_COPY_AE(a,e) ((a) = (e).weapons)
-# define WEPSET_EQ_AE(a,e) ((a) == (e).weapons)
-# define WEPSET_OR_AE(a,e) ((a) |= (e).weapons)
-# define WEPSET_AND_AE(a,e) ((a) &= (e).weapons)
-# define WEPSET_ANDNOT_AE(a,e) ((a) &~= (e).weapons)
-# define WEPSET_CONTAINS_ANY_AE(a,e) ((a) & (e).weapons)
-# define WEPSET_CONTAINS_ALL_AE(a,e) (((a) & (e).weapons) == (e))
-
-# define WEPSET_COPY_AA(a,b) ((a) = (b))
-# define WEPSET_EQ_AA(a,b) ((a) == (b))
-# define WEPSET_OR_AA(a,b) ((a) |= (b))
-# define WEPSET_AND_AA(a,b) ((a) &= (b))
-# define WEPSET_ANDNOT_AA(a,b) ((a) &~= (b))
-# define WEPSET_CONTAINS_ANY_AA(a,b) ((a) & (b))
-# define WEPSET_CONTAINS_ALL_AA(a,b) (((a) & (b)) == (b))
-
-# define WEPSET_COPY_AW(a,w) ((a) = power2of((w) - WEP_FIRST))
-# define WEPSET_EQ_AW(a,w) ((a) == power2of((w) - WEP_FIRST))
-# define WEPSET_OR_AW(a,w) ((a) |= power2of((w) - WEP_FIRST))
-# define WEPSET_AND_AW(a,w) ((a) &= power2of((w) - WEP_FIRST))
-# define WEPSET_ANDNOT_AW(a,w) ((a) &~= power2of((w) - WEP_FIRST))
-# define WEPSET_CONTAINS_AW(a,w) ((a) & power2of((w) - WEP_FIRST))
+# define WEPSET_COPY_AE(a,e) ((_WS_##a) = (e).weapons)
+# define WEPSET_EQ_AE(a,e) ((_WS_##a) == (e).weapons)
+# define WEPSET_OR_AE(a,e) ((_WS_##a) |= (e).weapons)
+# define WEPSET_AND_AE(a,e) ((_WS_##a) &= (e).weapons)
+# define WEPSET_ANDNOT_AE(a,e) ((_WS_##a) &~= (e).weapons)
+# define WEPSET_CONTAINS_ANY_AE(a,e) ((_WS_##a) & (e).weapons)
+# define WEPSET_CONTAINS_ALL_AE(a,e) (((_WS_##a) & (e).weapons) == (e))
+
+# define WEPSET_COPY_AA(a,b) ((_WS_##a) = (_WS_##b))
+# define WEPSET_EQ_AA(a,b) ((_WS_##a) == (_WS_##b))
+# define WEPSET_OR_AA(a,b) ((_WS_##a) |= (_WS_##b))
+# define WEPSET_AND_AA(a,b) ((_WS_##a) &= (_WS_##b))
+# define WEPSET_ANDNOT_AA(a,b) ((_WS_##a) &~= (_WS_##b))
+# define WEPSET_CONTAINS_ANY_AA(a,b) ((_WS_##a) & (_WS_##b))
+# define WEPSET_CONTAINS_ALL_AA(a,b) (((_WS_##a) & (_WS_##b)) == (_WS_##b))
+
+# define WEPSET_COPY_AW(a,w) ((_WS_##a) = power2of((w) - WEP_FIRST))
+# define WEPSET_EQ_AW(a,w) ((_WS_##a) == power2of((w) - WEP_FIRST))
+# define WEPSET_OR_AW(a,w) ((_WS_##a) |= power2of((w) - WEP_FIRST))
+# define WEPSET_AND_AW(a,w) ((_WS_##a) &= power2of((w) - WEP_FIRST))
+# define WEPSET_ANDNOT_AW(a,w) ((_WS_##a) &~= power2of((w) - WEP_FIRST))
+# define WEPSET_CONTAINS_AW(a,w) ((_WS_##a) & power2of((w) - WEP_FIRST))
 
 # ifdef CSQC
-#  define WEPSET_COPY_AS(a) ((a) = getstatf(STAT_WEAPONS))
+#  define WEPSET_COPY_AS(a) ((_WS_##a) = getstatf(STAT_WEAPONS))
 # endif
 #endif
 
@@ -151,8 +154,8 @@ float WEP_COUNT;
 float WEP_FIRST = 1;
 float WEP_LAST;
 #define WEP_MAXCOUNT 24
-float WEPBIT_ALL;
-float WEPBIT_SUPERWEAPONS;
+WEPSET_DECLARE_A(WEPBIT_ALL);
+WEPSET_DECLARE_A(WEPBIT_SUPERWEAPONS);
 // note: the fabs call is just there to hide "if result is constant" warning
 #define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
        float id; \
index a97f184d561691bc88e5c2b32318a3a0eea21cc0..18e4341718e67e698e12c76045a8d035418e8af8 100644 (file)
@@ -979,7 +979,7 @@ void havocbot_chooseweapon()
        float i;
 
        // ;)
-       if(WEPSET_EQ_AW(g_weaponarena, WEP_TUBA))
+       if(WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
        {
                self.switchweapon = WEP_TUBA;
                return;
index 18922fea776ae144ad23dcdf50ded97e18be6241..9c842d7c25f535a2e3b57fa599926fc6f8499f07 100644 (file)
@@ -1532,7 +1532,7 @@ void ClientConnect (void)
 
        if(clienttype(self) == CLIENTTYPE_REAL)
        {
-               if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena, WEP_TUBA))
+               if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
                        stuffcmd(self, "cl_cmd settemp chase_active 1\n");
        }
 
index e6fba28393a8d553a4a525164ca913ddc5ba0bc4..dabfa9803258da051ab66ef7722616b514477df2 100644 (file)
@@ -354,7 +354,7 @@ string W_Name(float weaponid);
 void FixIntermissionClient(entity e);
 void FixClientCvars(entity e);
 
-float weaponsInMap;
+WEPSET_DECLARE_A(weaponsInMap);
 
 .float respawn_countdown; // next number to count
 
index 5d086820e24cde732d54f8876845c67e78fa27bb..ef3b45aec54095bd5f050655671c11d8e099b5e1 100644 (file)
@@ -103,7 +103,7 @@ void UpdateFrags(entity player, float f)
 void W_SwitchWeapon_Force(entity e, float w);
 void GiveFrags (entity attacker, entity targ, float f, float deathtype)
 {
-       float w;
+       WEPSET_DECLARE_A(w);
 
        // TODO route through PlayerScores instead
        if(gameover) return;
@@ -160,8 +160,8 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                        WEPSET_ANDNOT_AW(w, culprit);
 
                        // among the remaining ones, choose one by random
-                       w = randombits(w, 1, FALSE);
-                       if(w)
+                       _WS_w = randombits(_WS_w, 1, FALSE); // FIXME
+                       if(!WEPSET_EMPTY_A(w))
                        {
                                WEPSET_OR_EA(attacker, w);
                                WEPSET_ANDNOT_EW(attacker, culprit);
index 7065542b1902db6b65b7faa35612b55d854aa5eb..3aaebde8f315a9309660e0efbef5bd8cf13a6adf 100644 (file)
@@ -740,6 +740,7 @@ float g_pickup_healthmega_anyway;
 float g_pickup_ammo_anyway;
 float g_pickup_weapons_anyway;
 float g_weaponarena;
+WEPSET_DECLARE_A(g_weaponarena_weapons);
 float g_weaponarena_random;
 float g_weaponarena_random_with_laser;
 string g_weaponarena_list;
@@ -749,7 +750,7 @@ float g_weapondamagefactor;
 float g_weaponforcefactor;
 float g_weaponspreadfactor;
 
-float start_weapons;
+WEPSET_DECLARE_A(start_weapons);
 float start_items;
 float start_ammo_shells;
 float start_ammo_nails;
@@ -758,7 +759,7 @@ float start_ammo_cells;
 float start_ammo_fuel;
 float start_health;
 float start_armorvalue;
-float warmup_start_weapons;
+WEPSET_DECLARE_A(warmup_start_weapons);
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -806,7 +807,7 @@ void readplayerstartcvars()
        string s;
 
        // initialize starting values for players
-       start_weapons = 0;
+       WEPSET_CLEAR_A(start_weapons);
        start_items = 0;
        start_ammo_shells = 0;
        start_ammo_nails = 0;
@@ -816,6 +817,8 @@ void readplayerstartcvars()
        start_armorvalue = cvar("g_balance_armor_start");
 
        g_weaponarena = 0;
+       WEPSET_CLEAR_A(g_weaponarena_weapons);
+
        s = cvar_string("g_weaponarena");
        if (s == "0" || s == "")
        {
@@ -833,34 +836,30 @@ void readplayerstartcvars()
        }
        else if (s == "all")
        {
+               g_weaponarena = 1;
                g_weaponarena_list = "All Weapons";
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
-               {
-                       e = get_weaponinfo(j);
-                       g_weaponarena |= e.weapons;
-                       weapon_action(e.weapon, WR_PRECACHE);
-               }
+                       WEPSET_OR_AW(g_weaponarena_weapons, j);
        }
        else if (s == "most")
        {
+               g_weaponarena = 1;
                g_weaponarena_list = "Most Weapons";
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
                        if (e.spawnflags & WEP_FLAG_NORMAL)
-                       {
-                               g_weaponarena |= e.weapons;
-                               weapon_action(e.weapon, WR_PRECACHE);
-                       }
+                               WEPSET_OR_AW(g_weaponarena_weapons, j);
                }
        }
        else if (s == "none")
        {
+               g_weaponarena = 1;
                g_weaponarena_list = "No Weapons";
-               g_weaponarena = WEPBIT_ALL + 1; // this supports no single weapon bit!
        }
        else
        {
+               g_weaponarena = 1;
                t = tokenize_console(s);
                g_weaponarena_list = "";
                for (i = 0; i < t; ++i)
@@ -871,8 +870,7 @@ void readplayerstartcvars()
                                e = get_weaponinfo(j);
                                if (e.netname == s)
                                {
-                                       g_weaponarena |= e.weapons;
-                                       weapon_action(e.weapon, WR_PRECACHE);
+                                       WEPSET_OR_AW(g_weaponarena_weapons, j);
                                        g_weaponarena_list = strcat(g_weaponarena_list, e.message, " & ");
                                        break;
                                }
@@ -896,7 +894,7 @@ void readplayerstartcvars()
                g_minstagib = 0; // incompatible
                g_pinata = 0; // incompatible
                g_weapon_stay = 0; // incompatible
-               start_weapons = g_weaponarena;
+               WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
                if(!(g_lms || g_ca))
                        start_items |= IT_UNLIMITED_AMMO;
        }
@@ -907,8 +905,7 @@ void readplayerstartcvars()
                g_bloodloss = 0; // incompatible
                start_health = 100;
                start_armorvalue = 0;
-               start_weapons = WEPBIT_MINSTANEX;
-               weapon_action(WEP_MINSTANEX, WR_PRECACHE);
+               WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
                g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
                start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
@@ -921,7 +918,7 @@ void readplayerstartcvars()
                {
                        e = get_weaponinfo(i);
                        if(want_weapon("g_start_weapon_", e, FALSE))
-                               start_weapons |= e.weapons;
+                               WEPSET_OR_AW(start_weapons, e.weapons);
                }
        }
 
@@ -979,7 +976,7 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = start_ammo_fuel;
                warmup_start_health = start_health;
                warmup_start_armorvalue = start_armorvalue;
-               warmup_start_weapons = start_weapons;
+               WEPSET_COPY_AA(warmup_start_weapons, start_weapons);
 
                if (!g_weaponarena && !g_minstagib && !g_ca)
                {
@@ -990,17 +987,17 @@ void readplayerstartcvars()
                        warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
                        warmup_start_health = cvar("g_warmup_start_health");
                        warmup_start_armorvalue = cvar("g_warmup_start_armor");
-                       warmup_start_weapons = 0;
+                       WEPSET_CLEAR_A(warmup_start_weapons);
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
                                if(want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns")))
-                                       warmup_start_weapons |= e.weapons;
+                                       WEPSET_OR_AW(warmup_start_weapons, j);
                        }
                }
        }
 
-       if (g_jetpack || (g_grappling_hook && (start_weapons & WEPBIT_HOOK)))
+       if (g_jetpack || (g_grappling_hook && WEPSET_CONTAINS_AW(start_weapons, WEPBIT_HOOK)))
        {
                g_grappling_hook = 0; // these two can't coexist, as they use the same button
                start_items |= IT_FUEL_REGEN;
@@ -1016,7 +1013,7 @@ void readplayerstartcvars()
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                e = get_weaponinfo(i);
-               if(e.weapons & (start_weapons | warmup_start_weapons))
+               if(WEPSET_CONTAINS_AW(start_weapons, j) || WEPSET_CONTAINS_AW(warmup_start_weapons, j))
                        weapon_action(e.weapon, WR_PRECACHE);
        }
 
index dc90336caf377e0277b267aa4930bc66f44f7eae..45aa9d14b09ad798a8b57c087471fd2c4d1863f0 100644 (file)
@@ -9,13 +9,6 @@ float nix_nextweapon_ammo;
 .float nix_lastinfotime;
 .float nix_nextincr;
 
-.float nix_save_cells;
-.float nix_save_shells;
-.float nix_save_nails;
-.float nix_save_rockets;
-.float nix_save_fuel;
-.float nix_save_weapons;
-
 float NIX_CanChooseWeapon(float wpn)
 {
        entity e;
@@ -253,28 +246,6 @@ MUTATOR_DEFINITION(mutator_nix)
                nix_nextweapon = 0;
 
                NIX_precache();
-
-               FOR_EACH_PLAYER(e)
-               {
-                       if(e.deadflag == DEAD_NO)
-                       {
-                               e.nix_save_cells = e.ammo_cells;
-                               e.nix_save_shells = e.ammo_shells;
-                               e.nix_save_nails = e.ammo_nails;
-                               e.nix_save_rockets = e.ammo_rockets;
-                               e.nix_save_fuel = e.ammo_fuel;
-                               e.nix_save_weapons = e.weapons;
-                       }
-                       else
-                       {
-                               e.nix_save_cells = 0;
-                               e.nix_save_shells = 0;
-                               e.nix_save_nails = 0;
-                               e.nix_save_rockets = 0;
-                               e.nix_save_fuel = 0;
-                               e.nix_save_weapons = 0;
-                       }
-               }
        }
 
        MUTATOR_ONREMOVE
@@ -283,12 +254,12 @@ MUTATOR_DEFINITION(mutator_nix)
 
                FOR_EACH_PLAYER(e) if(e.deadflag == DEAD_NO)
                {
-                       e.ammo_cells = max(start_ammo_cells, e.nix_save_cells);
-                       e.ammo_shells = max(start_ammo_shells, e.nix_save_shells);
-                       e.ammo_nails = max(start_ammo_nails, e.nix_save_nails);
-                       e.ammo_rockets = max(start_ammo_rockets, e.nix_save_rockets);
-                       e.ammo_fuel = max(start_ammo_fuel, e.nix_save_fuel);
-                       e.weapons = (start_weapons | e.nix_save_weapons);
+                       e.ammo_cells = start_ammo_cells;
+                       e.ammo_shells = start_ammo_shells;
+                       e.ammo_nails = start_ammo_nails;
+                       e.ammo_rockets = start_ammo_rockets;
+                       e.ammo_fuel = start_ammo_fuel;
+                       WEPSET_COPY_EA(e, start_weapons);
                        if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
                                e.switchweapon = w_getbestweapon(self);
                }
index 2365733c7abfb855e7f4766e295a7c783b9ec059..3e67ba9bda8c95d002b5ca0fa46236cbe6e38714 100644 (file)
@@ -29,7 +29,7 @@ float have_pickup_item(void)
                if(g_ca)
                        return FALSE;
                if(g_weaponarena)
-                       if((self.weapons & WEPBIT_ALL) || (self.items & IT_AMMO))
+                       if(!WEPSET_EMPTY_E(self) || (self.items & IT_AMMO))
                                return FALSE;
        }
        return TRUE;
@@ -265,7 +265,7 @@ void Item_RespawnCountdown (void)
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if((e.flags & FL_POWERUP) || (e.weapons & WEPBIT_SUPERWEAPONS))
+       if((e.flags & FL_POWERUP) || WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
@@ -571,7 +571,7 @@ void Item_Reset()
                if(self.waypointsprite_attached)
                        WaypointSprite_Kill(self.waypointsprite_attached);
 
-               if((self.flags & FL_POWERUP) | (self.weapons & WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
+               if((self.flags & FL_POWERUP) | WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
                        Item_ScheduleInitialRespawn(self);
        }
 }
@@ -854,7 +854,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        self.is_item = TRUE;
                }
 
-               weaponsInMap |= weaponid;
+               WEPSET_OR_AW(weaponsInMap, weaponid);
 
                precache_model (itemmodel);
                precache_sound (pickupsound);
@@ -1059,7 +1059,7 @@ void weapon_defaultspawnfunc(float wpn)
 
        if(!self.respawntime)
        {
-               if(e.weapons & WEPBIT_SUPERWEAPONS)
+               if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
                {
                        self.respawntime = g_pickup_respawntime_superweapon;
                        self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
@@ -1071,7 +1071,7 @@ void weapon_defaultspawnfunc(float wpn)
                }
        }
 
-       if(e.weapons & WEPBIT_SUPERWEAPONS)
+       if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
                if(!self.superweapons_finished)
                        self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
@@ -1095,7 +1095,7 @@ void weapon_defaultspawnfunc(float wpn)
        f = FL_WEAPON;
 
        // no weapon-stay on superweapons
-       if(e.weapons & WEPBIT_SUPERWEAPONS)
+       if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
                f |= FL_NO_WEAPON_STAY;
 
        // weapon stay isn't supported for teamed weapons
@@ -1784,7 +1784,7 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
 
        if(e.superweapons_finished <= 0)
-               if(self.weapons & WEPBIT_SUPERWEAPONS)
+               if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
                        e.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        if (g_minstagib)
index 024db232ba811bd9633afb85bf3b7f87d37d5a6e..1fb823da91fcedad865f5cec22a3ebab3008c94d 100644 (file)
@@ -36,7 +36,7 @@ void W_Porto_Fail (float failhard)
 
        self.realowner.porto_current = world;
 
-       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !WEPSET_CONTAINS_EW(self.realowner, WEPBIT_PORTO))
+       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !WEPSET_CONTAINS_EW(self.realowner, WEP_PORTO))
        {
                setsize (self, '-16 -16 0', '16 16 32');
                setorigin(self, self.origin + trace_plane_normal);