]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix 50 health waypoint showing while playing
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 26 Aug 2015 22:55:07 +0000 (08:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 26 Aug 2015 22:55:07 +0000 (08:55 +1000)
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/server/t_items.qc

index 23bba824d4df05b53f1d60e509cf2b1bc5b9012e..c3a025080d39315274a0676db7812d682001fc47 100644 (file)
@@ -41,12 +41,19 @@ int autocvar_hud_panel_itemstime_text = 1;
 #define hud_panel_itemstime_hidelarge false
 #endif
 
-bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons)
+bool Item_ItemsTime_SpectatorOnly(GameItem it)
 {
     return (false
-    || it.instanceOfPowerup
     || it == ITEM_ArmorMega     || (it == ITEM_ArmorLarge && !hud_panel_itemstime_hidelarge)
     || it == ITEM_HealthMega    || (it == ITEM_HealthLarge && !hud_panel_itemstime_hidelarge)
+    );
+}
+
+bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons)
+{
+    return (false
+    || it.instanceOfPowerup
+    || Item_ItemsTime_SpectatorOnly(it)
     || (_weapons & WEPSET_SUPERWEAPONS)
     );
 }
@@ -371,4 +378,4 @@ void HUD_ItemsTime()
     ));
 }
 
-#endif
\ No newline at end of file
+#endif
index 45fcbd7613358223fbb8e239da11789035aae715..fa25ea7ec0e9fe88336d1068b181c58e80fd506a 100644 (file)
@@ -410,6 +410,7 @@ void Item_Think()
        }
 }
 
+bool Item_ItemsTime_SpectatorOnly(GameItem it);
 bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons);
 float Item_ItemsTime_UpdateTime(entity e, float t);
 void Item_ItemsTime_SetTime(entity e, float t);
@@ -467,7 +468,8 @@ void Item_RespawnCountdown (void)
             wp.wp_extra = wpextra;
             if(self.waypointsprite_attached)
             {
-                if (self.items == IT_HEALTH || self.items == IT_ARMOR)
+                GameItem def = self.itemdef;
+                if (Item_ItemsTime_SpectatorOnly(def))
                     WaypointSprite_UpdateRule(self.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
                 WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
             }