]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/itemstime/itemstime.qc
Merge branch 'master' into terencehill/keyhunt
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / itemstime / itemstime.qc
index 3fe9de6d7d5f849ea9356d04b6930a59caf76769..3db867a5b9418655c8a96b3be6e7119bd26227bf 100644 (file)
@@ -49,18 +49,18 @@ float autocvar_hud_panel_itemstime_progressbar_maxtime = 30;
 string autocvar_hud_panel_itemstime_progressbar_name = "progressbar";
 float autocvar_hud_panel_itemstime_progressbar_reduced;
 bool autocvar_hud_panel_itemstime_hidespawned = 1;
-bool autocvar_hud_panel_itemstime_hidelarge = false;
+bool autocvar_hud_panel_itemstime_hidebig = false;
 int autocvar_hud_panel_itemstime_text = 1;
-#define hud_panel_itemstime_hidelarge autocvar_hud_panel_itemstime_hidelarge
+#define hud_panel_itemstime_hidebig autocvar_hud_panel_itemstime_hidebig
 #else
-#define hud_panel_itemstime_hidelarge false
+#define hud_panel_itemstime_hidebig false
 #endif
 
 bool Item_ItemsTime_SpectatorOnly(GameItem it)
 {
     return (false
-    || it == ITEM_ArmorMega     || (it == ITEM_ArmorLarge && !hud_panel_itemstime_hidelarge)
-    || it == ITEM_HealthMega    || (it == ITEM_HealthLarge && !hud_panel_itemstime_hidelarge)
+    || it == ITEM_ArmorMega     || (it == ITEM_ArmorBig && !hud_panel_itemstime_hidebig)
+    || it == ITEM_HealthMega    || (it == ITEM_HealthBig && !hud_panel_itemstime_hidebig)
     );
 }
 
@@ -137,11 +137,10 @@ void Item_ItemsTime_SetTimesForAllPlayers()
 float Item_ItemsTime_UpdateTime(entity e, float t)
 {
     bool isavailable = (t == 0);
-    FOREACH_ENTITY_FLOAT(pure_data, false,
+    IL_EACH(g_items, it != e,
     {
-        if(!(it.itemdef == e.itemdef || ((e.weapons & WEPSET_SUPERWEAPONS) && (it.weapons & WEPSET_SUPERWEAPONS) && clienttype(it) == CLIENTTYPE_NOTACLIENT)))
+        if(!(it.itemdef == e.itemdef || ((e.weapons & WEPSET_SUPERWEAPONS) && (it.weapons & WEPSET_SUPERWEAPONS))))
             continue;
-        if (e == it) continue;
         if (it.scheduledrespawntime <= time)
             isavailable = true;
         else if (t == 0 || it.scheduledrespawntime < t)
@@ -157,11 +156,9 @@ MUTATOR_HOOKFUNCTION(itemstime, reset_map_global)
     Item_ItemsTime_ResetTimes();
     // ALL the times need to be reset before .reset()ing each item
     // since Item_Reset schedules respawn of superweapons and powerups
-    FOREACH_ENTITY_FLOAT(pure_data, false,
+    IL_EACH(g_items, it.reset,
     {
-        if(IS_CLIENT(it))
-            continue;
-        if (it.reset) Item_ItemsTime_SetTime(it, 0);
+        Item_ItemsTime_SetTime(it, 0);
     });
     Item_ItemsTime_SetTimesForAllPlayers();
 }
@@ -307,7 +304,7 @@ void HUD_ItemsTime()
     if (count == 0)
         return;
 
-    HUD_Panel_UpdateCvars();
+    HUD_Panel_LoadCvars();
 
     vector pos, mySize;
     pos = panel_pos;
@@ -332,7 +329,7 @@ void HUD_ItemsTime()
     {
         if (autocvar__hud_configure)
         if (hud_configure_menu_open != 2)
-            HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+            HUD_Panel_DrawBg(); // also draw the bg of the entire panel
 
         // reduce panel to avoid spacing items
         if (itemstime_size.x / itemstime_size.y < ar)
@@ -371,7 +368,7 @@ void HUD_ItemsTime()
     }
 
     HUD_Scale_Enable();
-    HUD_Panel_DrawBg(1);
+    HUD_Panel_DrawBg();
 
     float row = 0, column = 0;
     bool item_available;