]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix an inconsistency with applying ITEM_FLAG_MUTATORBLOCKED
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 13 Mar 2023 15:24:41 +0000 (01:24 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 13 Mar 2023 17:54:07 +0000 (03:54 +1000)
qcsrc/server/items/items.qc

index 6b653d9c33ebde54776661e4481371a217239eec..ea69ece56bdd185295a4cf8fd4cb1ccdfbd72573 100644 (file)
@@ -98,6 +98,9 @@ void UpdateItemAfterTeleport(entity this)
 
 bool have_pickup_item(entity this)
 {
+       if (this.itemdef.spawnflags & ITEM_FLAG_MUTATORBLOCKED)
+               return false;
+
        if(this.itemdef.instanceOfPowerup)
        {
                if(autocvar_g_powerups > 0)
@@ -1165,12 +1168,6 @@ void StartItem(entity this, GameItem def)
 {
        def = def.m_spawnfunc_hookreplace(def, this);
 
-       if (def.spawnflags & ITEM_FLAG_MUTATORBLOCKED)
-       {
-               delete(this);
-               return; // TODO does not set startitem_failed
-       }
-
        this.classname = def.m_canonical_spawnfunc;
 
        _StartItem(