From a02a2495daa54fff82c9621325fda779609729d8 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 14 Mar 2024 16:13:00 +1000 Subject: [PATCH] monsters: ensure they can't be stuck when spawned If too stuck to fix the spawn fails. Closes #1657 Closes #2645 --- qcsrc/common/monsters/sv_monsters.qc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 628db8f7e..e5ff5127d 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -1548,6 +1548,13 @@ bool Monster_Spawn(entity this, bool check_appear, Monster mon) setorigin(this, trace_endpos); } + if (!nudgeoutofsolid(this)) + { + // Stuck and not fixable + Monster_Remove(this); + return false; + } + if(!(this.spawnflags & MONSTERFLAG_RESPAWNED)) monster_setupcolors(this); -- 2.39.2