From: bones_was_here Date: Thu, 14 Mar 2024 06:13:00 +0000 (+1000) Subject: monsters: ensure they can't be stuck when spawned X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a02a2495daa54fff82c9621325fda779609729d8;p=xonotic%2Fxonotic-data.pk3dir.git monsters: ensure they can't be stuck when spawned If too stuck to fix the spawn fails. Closes #1657 Closes #2645 --- 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);