Allow stations to specify their own custom emergency shuttles. (#12747)

* Allow individual stations to specify a custom emergency shuttle.

* Use better assert message.
This commit is contained in:
Vordenburg
2022-11-24 13:28:03 -05:00
committed by GitHub
parent 14fa25af84
commit 7c4ff1c03d
4 changed files with 27 additions and 13 deletions

View File

@@ -221,9 +221,10 @@ namespace Content.IntegrationTests.Tests
// Test shuttle can dock.
// This is done inside gamemap test because loading the map takes ages and we already have it.
var station = entManager.GetComponent<StationMemberComponent>(targetGrid!.Value).Station;
var shuttlePath = entManager.GetComponent<StationDataComponent>(station).EmergencyShuttlePath
.ToString();
var shuttle = mapLoader.LoadGrid(shuttleMap, entManager.GetComponent<StationDataComponent>(station).EmergencyShuttlePath.ToString());
var stationConfig = entManager.GetComponent<StationDataComponent>(station).StationConfig;
Assert.IsNotNull(stationConfig, $"{entManager.ToPrettyString(station)} had null StationConfig.");
var shuttlePath = stationConfig.EmergencyShuttlePath.ToString();
var shuttle = mapLoader.LoadGrid(shuttleMap, shuttlePath);
Assert.That(shuttle != null && shuttleSystem.TryFTLDock(entManager.GetComponent<ShuttleComponent>(shuttle.Value), targetGrid.Value), $"Unable to dock {shuttlePath} to {mapProto}");
mapManager.DeleteMap(shuttleMap);