]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/items/items.qc
Merge branch 'Mario/reset_clear_item_waypoints' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items / items.qc
index 89532a790efc8af3e7af5f2b968d8f7fb94d8db0..6a19a435f2a502c05d0e6c8ed39ca7565c3a3601 100644 (file)
@@ -634,7 +634,7 @@ void Item_Touch(entity this, entity toucher)
        {
                if (ITEM_TOUCH_NEEDKILL())
                {
-                       delete(this);
+                       RemoveItem(this);
                        return;
                }
        }
@@ -786,6 +786,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);
 }
@@ -983,7 +985,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")