]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/powerups/sv_powerups.qc
powerups_dropondeath: Added dropped waypoint
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / sv_powerups.qc
index 7bf005f91248ce9661f22b0fa5eb164b5d03bb12..181c56834200782a3c101acda066846fab20ad36 100644 (file)
@@ -108,6 +108,20 @@ void powerups_DropItem(entity this, StatusEffects effect)
 
        if(autocvar_g_powerups_dropondeath != 2)
                Item_SetExpiring(e, true);
+
+       // Create expiring waypoint
+       entity wp = WaypointSprite_Spawn(WP_Item, time_to_live * -1, 0, e, '0 0 1' * e.maxs.z, NULL, 0, e, waypointsprite_attached, true, RADARICON_Item);
+       wp.wp_extra = item.m_id;
+       wp.wp_reverse = 1;
+       WaypointSprite_UpdateBuildFinished(e.waypointsprite_attached, time + time_to_live);
+       WaypointSprite_Ping(this.waypointsprite_attached);
+}
+
+MUTATOR_HOOKFUNCTION(powerups, ItemTouched)
+{
+       entity e = M_ARGV(0, entity);
+       if(e.waypointsprite_attached)
+               WaypointSprite_Kill(e.waypointsprite_attached);
 }
 
 MUTATOR_HOOKFUNCTION(powerups, PlayerDies)