Skip to content

Commit b6ec393

Browse files
committed
Fixed mode timer issue
1 parent 14b11d6 commit b6ec393

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/Deathmatch/Deathmatch.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public override void Load(bool hotReload)
8484
}, TimerFlags.STOP_ON_MAPCHANGE);
8585

8686
double secTimer = 0;
87+
double lastUpdate = Server.CurrentTime;
8788
AddTimer(0.1f, () =>
8889
{
8990
if (playersWaitingForRespawn.Any())
@@ -123,9 +124,14 @@ public override void Load(bool hotReload)
123124
}
124125
}
125126
}
127+
126128
if (Config.Gameplay.IsCustomModes)
127129
{
128-
secTimer += 0.1;
130+
double now = Server.CurrentTime;
131+
double timer = now - lastUpdate;
132+
lastUpdate = now;
133+
134+
secTimer += timer;
129135
if (secTimer >= 1)
130136
{
131137
secTimer = 0;

0 commit comments

Comments
 (0)