]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
Merge branch 'TimePath/waypointsprites' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index 8213994144ce63aa3b625d4be12efd86d5f7d10c..45fcbd7613358223fbb8e239da11789035aae715 100644 (file)
@@ -5,8 +5,6 @@
 #if defined(SVQC)
     #include "_all.qh"
 
-    #include "waypointsprites.qh"
-
     #include "bot/bot.qh"
     #include "bot/waypoints.qh"
 
@@ -457,40 +455,22 @@ void Item_RespawnCountdown (void)
                self.count += 1;
                if(self.count == 1)
                {
-                       string name = string_null;
-                       vector rgb = '1 0 1';
+                       MUTATOR_CALLHOOK(Item_RespawnCountdown, string_null, '0 0 0');
+                       int wpextra = 0;
             entity e = self.itemdef;
-            if (e) {
-                name = e.m_waypoint;
-                rgb = e.m_color;
-            }
-                       MUTATOR_CALLHOOK(Item_RespawnCountdown, name, rgb);
-                       name = item_name;
-                       rgb = item_color;
-                       if(self.flags & FL_WEAPON)
-                       {
+            if (e) wpextra = e.m_id;
+                       if (self.flags & FL_WEAPON) {
                                entity wi = get_weaponinfo(self.weapon);
-                               if(wi)
-                               {
-                                       name = wi.wpmodel;
-                                       rgb = '1 0 0';
-                               }
-                       }
-                       if(name)
-                       {
-                               WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
-                               if(self.waypointsprite_attached)
-                               {
-                                       if (self.items == IT_HEALTH || self.items == IT_ARMOR)
-                                               WaypointSprite_UpdateRule(self.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
-                                       WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
-                               }
-                       }
-                       else
-                       {
-                               print("Unknown powerup-marked item is wanting to respawn\n");
-                               localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
+                               if (wi) wpextra = wi.m_id;
                        }
+            entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP);
+            wp.wp_extra = wpextra;
+            if(self.waypointsprite_attached)
+            {
+                if (self.items == IT_HEALTH || self.items == IT_ARMOR)
+                    WaypointSprite_UpdateRule(self.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
+                WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
+            }
                }
 
                if(self.waypointsprite_attached)