]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the constant string for player classname where loop macros can't be used
authorMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:27:46 +0000 (05:27 +1000)
committerMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:27:46 +0000 (05:27 +1000)
qcsrc/common/physics/player.qc
qcsrc/server/cl_client.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc

index 6cc47ea63a4dd37df944a492e4f2ed0f243dc1ae..bd79aa6483d922abea1ee8f5b06dff2747325218 100644 (file)
@@ -1405,7 +1405,7 @@ void PM_Main(entity this)
                        this.spectatorspeed = maxspeed_mod;
                if (this.impulse && this.impulse <= 19 || (this.impulse >= 200 && this.impulse <= 209) || (this.impulse >= 220 && this.impulse <= 229))
                {
-                       if (this.lastclassname != "player")
+                       if (this.lastclassname != STR_PLAYER)
                        {
                                if (this.impulse == 10 || this.impulse == 15 || this.impulse == 18 || (this.impulse >= 200 && this.impulse <= 209))
                                        this.spectatorspeed = bound(1, this.spectatorspeed + 0.5, 5);
index ffbfe02ff946bfc4daccc38a2795359ebe13ef7e..25750e97202a70f5a7c24271fa66e4709f58437a 100644 (file)
@@ -1733,12 +1733,12 @@ bool Spectate(entity pl)
 
 bool SpectateNext()
 {SELFPARAM();
-       other = find(self.enemy, classname, "player");
+       other = find(self.enemy, classname, STR_PLAYER);
 
        if (MUTATOR_CALLHOOK(SpectateNext, self, other))
                other = spec_player;
        else if (!other)
-               other = find(other, classname, "player");
+               other = find(other, classname, STR_PLAYER);
 
        if(other) { SetSpectatee(self, other); }
 
@@ -1748,7 +1748,7 @@ bool SpectateNext()
 bool SpectatePrev()
 {SELFPARAM();
        // NOTE: chain order is from the highest to the lower entnum (unlike find)
-       other = findchain(classname, "player");
+       other = findchain(classname, STR_PLAYER);
        if (!other) // no player
                return false;
 
index 19b551b241613c37c953e593b4b5162f5e71f3a9..e70a5d3c8edb49703b3e80d0fedfa4e1a1062656 100644 (file)
@@ -190,12 +190,12 @@ entity CA_SpectateNext(entity player, entity start)
 {
     if (SAME_TEAM(start, player)) return start;
        // continue from current player
-       for (entity e = start; (e = find(e, classname, "player")); )
+       for (entity e = start; (e = find(e, classname, STR_PLAYER)); )
        {
                if (SAME_TEAM(player, e)) return e;
        }
        // restart from begining
-       for (entity e = NULL; (e = find(e, classname, "player")); )
+       for (entity e = NULL; (e = find(e, classname, STR_PLAYER)); )
        {
                if (SAME_TEAM(player, e)) return e;
        }
index c2bfe91caeb6c9af69e15704b458e299c012a68c..9c9e191d2065d59423dd4edadb6a10d1d266417a 100644 (file)
@@ -82,10 +82,10 @@ int WinningCondition_LMS()
 
        int l = LMS_NewPlayerLives();
 
-       head = find(world, classname, "player");
+       head = find(world, classname, STR_PLAYER);
        if(head)
                have_player = true;
-       head2 = find(head, classname, "player");
+       head2 = find(head, classname, STR_PLAYER);
        if(head2)
                have_players = true;