From: TimePath Date: Wed, 26 Aug 2015 22:55:07 +0000 (+1000) Subject: Fix 50 health waypoint showing while playing X-Git-Tag: xonotic-v0.8.2~2024 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=76165a8426ab57d5fe02f7e5f04b1f8edbb6afcb;p=xonotic%2Fxonotic-data.pk3dir.git Fix 50 health waypoint showing while playing --- diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index 23bba824d..c3a025080 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -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 diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 45fcbd761..fa25ea7ec 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -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); }