]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
Weapons: store activeweapon as direct weapon reference
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / nexball / nexball.qc
index 0d56d37155b0359113d2e096e83619c6568a722d..97bfe91538f6e2e820f4eb10003e9a771b9054b9 100644 (file)
@@ -180,7 +180,7 @@ void GiveBall(entity plyr, entity ball)
        }
 
        plyr.(weaponentity).weapons = plyr.weapons;
-       plyr.(weaponentity).m_switchweapon = Weapons_from(plyr.weapon);
+       plyr.(weaponentity).m_switchweapon = PS(plyr).m_weapon;
        plyr.weapons = WEPSET(NEXBALL);
        setself(plyr);
        Weapon w = WEP_NEXBALL;
@@ -1021,12 +1021,12 @@ MUTATOR_HOOKFUNCTION(nb, PlayerPhysics)
 
 MUTATOR_HOOKFUNCTION(nb, ForbidThrowCurrentWeapon)
 {SELFPARAM();
-       return self.weapon == WEP_NEXBALL.m_id;
+       return PS(self).m_weapon == WEP_NEXBALL;
 }
 
 MUTATOR_HOOKFUNCTION(nb, ForbidDropCurrentWeapon)
 {SELFPARAM();
-       return self.weapon == WEP_MORTAR.m_id; // TODO: what is this for?
+       return PS(self).m_weapon == WEP_MORTAR; // TODO: what is this for?
 }
 
 MUTATOR_HOOKFUNCTION(nb, FilterItem)