]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make hidden itemstime mode actually functional
authorMario <mario@smbclan.net>
Sat, 30 Jul 2016 20:01:08 +0000 (06:01 +1000)
committerMario <mario@smbclan.net>
Sat, 30 Jul 2016 20:01:08 +0000 (06:01 +1000)
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/stats.qh

index cdd163f57a6ae879b7a69d39f37d5b1da41705f5..c6afa33161c954d70f75fda41e2841afa4f20273 100644 (file)
@@ -180,14 +180,14 @@ MUTATOR_HOOKFUNCTION(itemstime, ClientConnect, CBC_ORDER_LAST)
        {
                // client became player on connection skipping putObserverInServer step
                if (IS_REAL_CLIENT(player))
-               if (warmup_stage)
+               if (warmup_stage || autocvar_sv_itemstime == 2)
                        Item_ItemsTime_SetTimesForPlayer(player);
        }
 }
 
 MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn)
 {
-    if (warmup_stage) return;
+    if (warmup_stage || autocvar_sv_itemstime == 2) return;
     entity player = M_ARGV(0, entity);
 
     Item_ItemsTime_ResetTimesForPlayer(player);
@@ -270,7 +270,7 @@ void HUD_ItemsTime()
     {
         if (!(
             (autocvar_hud_panel_itemstime == 1 && spectatee_status != 0)
-        ||     (autocvar_hud_panel_itemstime == 2 && (spectatee_status != 0 || warmup_stage))
+        ||     (autocvar_hud_panel_itemstime == 2 && (spectatee_status != 0 || warmup_stage || STAT(ITEMSTIME) == 2))
             )) { return; }
     }
     else
index 1422f7c0d7498b80b64267e4978d83addd375714..070379b4ae7b00caf0c674f0517a6eb572c8585b 100644 (file)
@@ -486,7 +486,7 @@ void Draw_WaypointSprite(entity this)
         case SPRITERULE_SPECTATOR:
             if (!(
                 (autocvar_g_waypointsprite_itemstime == 1 && t == NUM_SPECTATOR + 1)
-            || (autocvar_g_waypointsprite_itemstime == 2 && (t == NUM_SPECTATOR + 1 || warmup_stage))
+            || (autocvar_g_waypointsprite_itemstime == 2 && (t == NUM_SPECTATOR + 1 || warmup_stage || STAT(ITEMSTIME) == 2))
                 ))
                 return;
             spriteimage = this.netname;
index bbf315183d12cd24c0f4749fdbb72919b31a1ed5..c7fc313a8802b082147098b3c1e391570ebff0ab 100644 (file)
@@ -124,6 +124,7 @@ REGISTER_STAT(BUFF_TIME, float)
 REGISTER_STAT(CTF_FLAGSTATUS, int)
 REGISTER_STAT(ENTRAP_ORB, float)
 REGISTER_STAT(ENTRAP_ORB_ALPHA, float)
+REGISTER_STAT(ITEMSTIME, int, autocvar_sv_itemstime)
 
 #ifdef SVQC
 int autocvar_g_multijump;