Master fix (#913)
* loadmap fixes * Update PostMapInitTest and CP14StationZLevelsSystem to enhance map whitelisting and initialization * fix #907 * Update PostMapInitTest.cs
This commit is contained in:
@@ -49,6 +49,15 @@ namespace Content.IntegrationTests.Tests
|
||||
//CrystallEdge Map replacement
|
||||
"/Maps/_CP14/dev_map.yml",
|
||||
//CrystallEdge Map replacement end
|
||||
"/Maps/centcomm.yml",
|
||||
"/Maps/bagel.yml", // Contains mime's rubber stamp --> Either fix this, remove the category, or remove this comment if intentional.
|
||||
"/Maps/gate.yml", // Contains positronic brain and LSE-1200c "Perforator"
|
||||
"/Maps/meta.yml", // Contains warden's rubber stamp
|
||||
"/Maps/reach.yml", // Contains handheld crew monitor
|
||||
"/Maps/Shuttles/ShuttleEvent/cruiser.yml", // Contains LSE-1200c "Perforator"
|
||||
"/Maps/Shuttles/ShuttleEvent/honki.yml", // Contains golden honker, clown's rubber stamp
|
||||
"/Maps/Shuttles/ShuttleEvent/instigator.yml", // Contains EXP-320g "Friendship"
|
||||
"/Maps/Shuttles/ShuttleEvent/syndie_evacpod.yml", // Contains syndicate rubber stamp
|
||||
};
|
||||
|
||||
private static readonly string[] GameMaps =
|
||||
|
||||
@@ -89,20 +89,21 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
|
||||
if (!Deleted(station.Comp.Shuttle))
|
||||
return;
|
||||
|
||||
if (!_loader.TryLoadMap(station.Comp.ShuttlePath, out var tradepostMap, out var shuttleUids))
|
||||
var tradepostMap = _mapManager.CreateMap();
|
||||
|
||||
if (!_loader.TryLoadGrid(tradepostMap ,station.Comp.ShuttlePath, out var shuttle))
|
||||
return;
|
||||
|
||||
|
||||
var shuttle = shuttleUids.First();
|
||||
station.Comp.Shuttle = shuttle;
|
||||
station.Comp.TradePostMap = _mapManager.GetMapEntityId(tradepostMap.Value.Comp.MapId);
|
||||
station.Comp.TradePostMap = _mapManager.GetMapEntityId(tradepostMap);
|
||||
var travelingStoreShipComp = EnsureComp<CP14TravelingStoreShipComponent>(station.Comp.Shuttle.Value);
|
||||
travelingStoreShipComp.Station = station;
|
||||
|
||||
var member = EnsureComp<StationMemberComponent>(shuttle);
|
||||
var member = EnsureComp<StationMemberComponent>(shuttle.Value);
|
||||
member.Station = station;
|
||||
|
||||
var roundRemover = EnsureComp<CP14RoundRemoveShuttleComponent>(shuttle);
|
||||
var roundRemover = EnsureComp<CP14RoundRemoveShuttleComponent>(shuttle.Value);
|
||||
roundRemover.Station = station;
|
||||
|
||||
station.Comp.NextTravelTime = _timing.CurTime + TimeSpan.FromSeconds(10f);
|
||||
|
||||
@@ -25,7 +25,7 @@ public sealed partial class CP14DemiplaneSystem
|
||||
_chat.TrySendInGameICMessage(exit,
|
||||
ev.Message,
|
||||
InGameICChatType.Whisper,
|
||||
ChatTransmitRange.NoGhosts,
|
||||
ChatTransmitRange.HideChat,
|
||||
nameOverride: Loc.GetString("cp14-demiplane-echoes"),
|
||||
hideLog: true);
|
||||
}
|
||||
|
||||
@@ -67,19 +67,22 @@ public sealed partial class CP14StationZLevelsSystem : EntitySystem
|
||||
continue;
|
||||
}
|
||||
|
||||
var mapUid = _map.CreateMap(out var mapId);
|
||||
var member = EnsureComp<StationMemberComponent>(mapUid);
|
||||
member.Station = ent;
|
||||
//var mapUid = _map.CreateMap(out var mapId);
|
||||
|
||||
Log.Info($"Created map {mapId} for CP14StationZLevelsSystem at level {map}");
|
||||
|
||||
if (!_mapLoader.TryLoadMap(level.Path.Value, out var mapEnt, out var grids))
|
||||
{
|
||||
Log.Error($"Failed to load map for CP14StationZLevelsSystem at level {map}!");
|
||||
Del(mapUid);
|
||||
continue;
|
||||
}
|
||||
ent.Comp.LevelEntities.Add(mapId, map);
|
||||
|
||||
Log.Info($"Created map {mapEnt.Value.Comp.MapId} for CP14StationZLevelsSystem at level {map}");
|
||||
|
||||
_map.InitializeMap(mapEnt.Value.Comp.MapId);
|
||||
var member = EnsureComp<StationMemberComponent>(mapEnt.Value);
|
||||
member.Station = ent;
|
||||
|
||||
ent.Comp.LevelEntities.Add(mapEnt.Value.Comp.MapId, map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user