From: Mario Date: Thu, 31 Dec 2015 19:27:46 +0000 (+1000) Subject: Use the constant string for player classname where loop macros can't be used X-Git-Tag: xonotic-v0.8.2~1341 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=afc1ca7fd12daccdab7d9e39467b3f8dceadbefb;p=xonotic%2Fxonotic-data.pk3dir.git Use the constant string for player classname where loop macros can't be used --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 6cc47ea63..bd79aa648 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -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); diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index ffbfe02ff..25750e972 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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; diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index 19b551b24..e70a5d3c8 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -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; } diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index c2bfe91ca..9c9e191d2 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -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;