]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix overkill superweapon waypoints
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 01:31:10 +0000 (11:31 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 01:31:10 +0000 (11:31 +1000)
Closes #1553

qcsrc/server/t_items.qc

index 0fbbf2732ed8545401b320a2fc00ec39c74ee1a5..408bc4388a92d35f2d6330a3aa50d9fa14dd48b6 100644 (file)
@@ -472,15 +472,24 @@ void Item_RespawnCountdown (void)
                if(self.count == 1)
                {
                        MUTATOR_CALLHOOK(Item_RespawnCountdown, string_null, '0 0 0');
-                       int wpextra = 0;
-            entity e = self.itemdef;
-            if (e) wpextra = e.m_id;
-                       if (self.flags & FL_WEAPON) {
-                               entity wi = get_weaponinfo(self.weapon);
-                               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;
+                       do {
+                               {
+                                       entity wi = get_weaponinfo(self.weapon);
+                                       if (wi.m_id) {
+                                               entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP);
+                                               wp.wp_extra = wi.m_id;
+                                               break;
+                                       }
+                               }
+                               {
+                                       entity ii = self.itemdef;
+                                       if (ii.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 = ii.m_id;
+                                               break;
+                                       }
+                               }
+                       } while (0);
             if(self.waypointsprite_attached)
             {
                 GameItem def = self.itemdef;