]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/items/items.qc
Clear item waypoints when deleting items to fix issues with dropped powerups
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items / items.qc
index 99c0165fd3a1b51061979bf4ff3fb384ab3bcdd2..5758a7fda777d2b2191402661ea3c740f7cb3efc 100644 (file)
@@ -635,7 +635,7 @@ void Item_Touch(entity this, entity toucher)
        {
                if (ITEM_TOUCH_NEEDKILL())
                {
-                       delete(this);
+                       RemoveItem(this);
                        return;
                }
        }
@@ -787,6 +787,8 @@ void Item_FindTeam(entity this)
 void RemoveItem(entity this)
 {
        if(wasfreed(this) || !this) { return; }
+       if(this.waypointsprite_attached)
+               WaypointSprite_Kill(this.waypointsprite_attached);
        Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
        delete(this);
 }
@@ -977,7 +979,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
 
        if (Item_IsLoot(this))
        {
-               this.reset = SUB_Remove;
+               this.reset = RemoveItem;
                set_movetype(this, MOVETYPE_TOSS);
 
                // Savage: remove thrown items after a certain period of time ("garbage collection")