Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pirate Radio Heisentest Fix #1225

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Content.Shared.CCVar;
using Robust.Shared.Serialization.Manager;
using Content.Shared.Parallax.Biomes;
using Robust.Shared.Map;

namespace Content.Server.StationEvents.Events;

Expand All @@ -24,6 +25,7 @@ public sealed class PirateRadioSpawnRule : StationEventSystem<PirateRadioSpawnRu
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly TransformSystem _xform = default!;
[Dependency] private readonly ISerializationManager _serializationManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

protected override void Started(EntityUid uid, PirateRadioSpawnRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
Expand All @@ -46,6 +48,9 @@ protected override void Started(EntityUid uid, PirateRadioSpawnRuleComponent com
return;

var targetStation = _random.Pick(stations);
if (!_mapManager.MapExists(Transform(targetStation).MapID))
return; /// SHUT UP HEISENTESTS. DIE.

var randomOffset = _random.NextVector2(component.MinimumDistance, component.MaximumDistance);

var outpostOptions = new MapLoadOptions
Expand All @@ -54,7 +59,7 @@ protected override void Started(EntityUid uid, PirateRadioSpawnRuleComponent com
LoadMap = false,
};

if (!_map.TryLoad(GameTicker.DefaultMap, _random.Pick(component.PirateRadioShuttlePath), out var outpostids, outpostOptions))
if (!_map.TryLoad(Transform(targetStation).MapID, _random.Pick(component.PirateRadioShuttlePath), out var outpostids, outpostOptions))
return;

SpawnDebris(component, outpostids);
Expand Down
Loading