From: bones_was_here Date: Thu, 14 Mar 2024 05:20:18 +0000 (+1000) Subject: monsters: stop following player if they spectate in FFA gametypes X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3fc6ebda14c821b0b8d9bbc71eb2bb37ef634d24;p=xonotic%2Fxonotic-data.pk3dir.git monsters: stop following player if they spectate in FFA gametypes Fixes #2705 In teamplay the DIFF_TEAM check already handled this. --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 4dff36c97..628db8f7e 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -828,8 +828,9 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) runspeed = bound(0, M_ARGV(1, float) * MONSTER_SKILLMOD(this), runspeed * 2.5); // limit maxspeed to prevent craziness walkspeed = bound(0, M_ARGV(2, float) * MONSTER_SKILLMOD(this), walkspeed * 2.5); // limit maxspeed to prevent craziness - if(teamplay && autocvar_g_monsters_teams) - if(DIFF_TEAM(this.monster_follow, this)) + if(this.monster_follow) + if((teamplay && autocvar_g_monsters_teams && DIFF_TEAM(this.monster_follow, this)) + || IS_SPEC(this.monster_follow) || IS_OBSERVER(this.monster_follow)) this.monster_follow = NULL; if(this.state == MONSTER_ATTACK_RANGED && IS_ONGROUND(this))