]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
monsters: stop following player if they spectate in FFA gametypes
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 14 Mar 2024 05:20:18 +0000 (15:20 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 14 Mar 2024 08:14:13 +0000 (18:14 +1000)
Fixes #2705

In teamplay the DIFF_TEAM check already handled this.

qcsrc/common/monsters/sv_monsters.qc

index 4dff36c977f0a29853237efc9421861ff9573867..628db8f7e852bd0df1f3cff0aaf579172a0cfe31 100644 (file)
@@ -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))