Skip to content

Commit

Permalink
fix: only execute command delayed
Browse files Browse the repository at this point in the history
  • Loading branch information
derkalle4 committed Jan 5, 2025
1 parent ef98109 commit 189f95e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/MapModifiers+ExecuteServerCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ private void ServerCommandsOnMapStart(string mapName)
{
foreach (MapConfig mapConfig in _currentMapConfigs)
{
// delay execution to allow server to load configurations first
AddTimer(2.0f, () =>
// server commands
foreach (var command in mapConfig.ServerCommands)
{
// server commands
foreach (var command in mapConfig.ServerCommands)
Console.WriteLine(Localizer["servercommands.execute"].Value
.Replace("{command}", command)
.Replace("{mapName}", mapName));
// delay execution to allow server to load configurations first
AddTimer(2.0f, () =>
{
Console.WriteLine(Localizer["servercommands.execute"].Value
.Replace("{command}", command)
.Replace("{mapName}", mapName));
Server.ExecuteCommand(command);
}
});
});
}
}
}
}
Expand Down

0 comments on commit 189f95e

Please sign in to comment.