]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed items respawn time
authorz411 <z411@omaera.org>
Wed, 28 Apr 2021 19:36:25 +0000 (15:36 -0400)
committerz411 <z411@omaera.org>
Wed, 28 Apr 2021 19:36:25 +0000 (15:36 -0400)
qcsrc/common/mutators/mutator/itemstime/itemstime.qc

index 19045727b6cc8e8a0ae603d0315713c89b148924..d30f1694306766c5420a38e5941cee26cb74deea 100644 (file)
@@ -277,7 +277,18 @@ float Item_ItemsTime_GetTime(int item)
         return -1; // don't show others
     }
     else
-        return ItemsTime_time[item];
+       {
+               float game_starttime = STAT(GAMESTARTTIME);
+               float timeout_last = STAT(TIMEOUT_LAST);
+               
+               if(ItemsTime_time[item] > 0 && game_starttime < time)
+                       if(timeout_last)
+                               return ItemsTime_time[item] + game_starttime - timeout_last + time;
+                       else
+                               return ItemsTime_time[item] + game_starttime;
+               else
+                       return ItemsTime_time[item];
+       }
 }
 
 void HUD_ItemsTime()