Skip to content

Commit

Permalink
:trollface:
Browse files Browse the repository at this point in the history
  • Loading branch information
lzk228 committed Jul 15, 2024
1 parent 37557a3 commit 1f10c21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Content.Server/GameTicking/Rules/LoadMapRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Robust.Server.Maps;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

namespace Content.Server.GameTicking.Rules;

Expand All @@ -16,6 +17,7 @@ public sealed class LoadMapRuleSystem : GameRuleSystem<LoadMapRuleComponent>
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly GridPreloaderSystem _gridPreloader = default!;
[Dependency] private readonly IRobustRandom _random = default!;

protected override void Added(EntityUid uid, LoadMapRuleComponent comp, GameRuleComponent rule, GameRuleAddedEvent args)
{
Expand Down Expand Up @@ -54,7 +56,7 @@ protected override void Added(EntityUid uid, LoadMapRuleComponent comp, GameRule
else if (comp.PreloadedGrid != null && comp.PreloadedGrid.Count > 0)
{
// Choose random preloaded grid from the list
var preloaded = comp.PreloadedGrid[Random.Shared.Next(comp.PreloadedGrid.Count)];
var preloaded = _random.Pick(comp.PreloadedGrid);

// TODO: If there are no preloaded grids left, any rule announcements will still go off!
if (!_gridPreloader.TryGetPreloadedGrid(preloaded, out var loadedShuttle))
Expand Down

0 comments on commit 1f10c21

Please sign in to comment.