From: Mario Date: Sat, 12 Nov 2022 03:38:23 +0000 (+1000) Subject: Abort processing a monster's dropped item if it couldn't be placed, resolves the... X-Git-Tag: xonotic-v0.8.6~246^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a9786d5741a2c4ecf55cdca9bbf8b25eb98a4122;p=xonotic%2Fxonotic-data.pk3dir.git Abort processing a monster's dropped item if it couldn't be placed, resolves the error produced by #2734 --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 1c8035380..0194d4451 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -55,6 +55,8 @@ void monster_dropitem(entity this, entity attacker) { e.noalign = true; StartItem(e, e.monster_loot); + if(startitem_failed || wasfreed(e)) + return; e.gravity = 1; setorigin(e, org); e.velocity = randomvec() * 175 + '0 0 325'; diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 6a19a435f..7673d8bd3 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -1161,7 +1161,7 @@ void StartItem(entity this, GameItem def) if (def.spawnflags & ITEM_FLAG_MUTATORBLOCKED) { delete(this); - return; + return; // TODO does not set startitem_failed } this.classname = def.m_canonical_spawnfunc;