]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Abort processing a monster's dropped item if it couldn't be placed, resolves the...
authorMario <mario.mario@y7mail.com>
Sat, 12 Nov 2022 03:38:23 +0000 (13:38 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 12 Nov 2022 03:38:23 +0000 (13:38 +1000)
qcsrc/common/monsters/sv_monsters.qc
qcsrc/server/items/items.qc

index 1c80353804135172dd997f2cf5e89f4f027245ce..0194d445119efa277251743b3101f169190a838d 100644 (file)
@@ -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';
index 6a19a435f2a502c05d0e6c8ed39ca7565c3a3601..7673d8bd359cc25adec0d1ccd25b2adc2094b066 100644 (file)
@@ -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;