]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
RJZ: Fixed shards getting counted in warmup stage
authorz411 <z411@omaera.org>
Tue, 19 Oct 2021 20:03:31 +0000 (17:03 -0300)
committerz411 <z411@omaera.org>
Tue, 19 Oct 2021 20:03:31 +0000 (17:03 -0300)
qcsrc/common/mutators/mutator/itemstime/itemstime.qc
qcsrc/server/command/vote.qc
qcsrc/server/items/items.qc
qcsrc/server/world.qc

index 89167379a7b1640d6704a5af0c53dd8b68693633..bc14a48d4d056761dd6c2fc27c033e54fa7ea0ee 100644 (file)
@@ -224,7 +224,7 @@ void DrawItemsTimeItemFixed(vector myPos, vector mySize, float ar, string item_i
         picpos = myPos;
     }
     
-    drawstring_aspect(numpos, ftos(t), vec2(((ar - 1)/ar) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
+    drawstring_aspect(numpos, (t < 0 ? "-" : ftos(t)), vec2(((ar - 1)/ar) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
     drawpic_aspect(picpos, item_icon, '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
index a179438ce20d77f590237145102bd9b67e1bfd5b..57d58dc95a70927258de3ff4fde16c3abcf3bb29 100644 (file)
@@ -348,6 +348,12 @@ void reset_map(bool dorespawn)
                if (round_handler_IsActive())
                        round_handler_Reset(game_starttime);
        }
+       
+       // for RJZ
+       if (autocvar_g_count_shards) {
+               total_shards = 0;
+               send_TotalShardsAll();
+       }
 
        if (shuffleteams_on_reset_map)
        {
index 06f1333aaf572e543ecf480603bdbd51834c35a0..675c9cb36e9e845c5302f2e5294ff6a1ca20f8cd 100644 (file)
@@ -529,7 +529,7 @@ bool Item_GiveTo(entity item, entity player)
        pickedup |= Item_GiveAmmoTo(item, player, RES_FUEL, g_pickup_fuel_max);
        
        // for RJZ
-       if (autocvar_g_count_shards && item.itemdef == ITEM_ArmorSmall) {
+       if (autocvar_g_count_shards && !warmup_stage && item.itemdef == ITEM_ArmorSmall) {
                total_shards++;
                send_TotalShardsAll();
        }
index 81f83218b6a7efc400809f2ca86ed5625108a6a9..04201090d44f4d87bd37aee74328c86279efa9f1 100644 (file)
@@ -1062,11 +1062,17 @@ spawnfunc(worldspawn)
 
        WinningConditionHelper(this); // set worldstatus
 
-       world_initialized = 1;
-       __spawnfunc_spawn_all();
-       
        if(!warmup_stage)
                round_handler_Activate(true);
+       
+       // for RJZ
+       if (autocvar_g_count_shards && warmup_stage) {
+               total_shards = -2;
+               send_TotalShardsAll();
+       }
+       
+       world_initialized = 1;
+       __spawnfunc_spawn_all();
 }
 
 spawnfunc(light)