Skip to content

Commit 80ebc56

Browse files
committed
Fix mode early advance if player leave during load
1 parent ee7f736 commit 80ebc56

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[submodule "NetworkDebugger/Spectrum"]
22
path = NetworkDebugger/Spectrum
33
url = https://github.com/Ciastex/Spectrum
4+
ignore = dirty
45
[submodule "NetworkDebugger/Harmony"]
56
path = NetworkDebugger/Harmony
67
url = https://github.com/pardeike/Harmony
8+
ignore = dirty
79
[submodule "Patcher/dnlib"]
810
path = Patcher/dnlib
911
url = https://github.com/0xd4d/dnlib
12+
ignore = dirty

DistanceServer/PluginProjects/BasicAutoServer/BasicAutoServer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ System.Collections.IEnumerator DoLoadWorkshopLevels()
232232

233233
void AttemptToAdvanceLevel()
234234
{
235+
if (Server.StartingLevel || !Server.HasModeStarted)
236+
{
237+
Log.Debug($"Mode not started, not advancing normally.");
238+
return;
239+
}
235240
if (Server.ValidPlayers.Count == 0)
236241
{
237242
Log.Debug($"No players, not advancing normally.");
@@ -248,6 +253,7 @@ void AttemptToAdvanceLevel()
248253
}
249254
if (canAdvance)
250255
{
256+
Log.Debug($"Advancing because all players with cars have finished.");
251257
Server.SayChatMessage(true, "All players finished. Advancing to the next level in 10 seconds.");
252258
AdvanceLevel();
253259
}

0 commit comments

Comments
 (0)