From 3fc6ebda14c821b0b8d9bbc71eb2bb37ef634d24 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 14 Mar 2024 15:20:18 +1000 Subject: [PATCH] monsters: stop following player if they spectate in FFA gametypes Fixes #2705 In teamplay the DIFF_TEAM check already handled this. --- qcsrc/common/monsters/sv_monsters.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)) -- 2.39.2