roof adapt

This commit is contained in:
Ed
2025-02-16 22:56:10 +03:00
parent bc53ed4aa5
commit 82d6fe07fe
5 changed files with 35 additions and 25 deletions

View File

@@ -1,3 +1,4 @@
using System.Linq;
using Content.Server._CP14.Currency;
using Content.Server._CP14.RoundRemoveShuttle;
using Content.Server.Shuttles.Systems;
@@ -13,6 +14,7 @@ using Content.Shared.Storage;
using Content.Shared.Storage.EntitySystems;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -87,14 +89,13 @@ public sealed partial class CP14CargoSystem : CP14SharedCargoSystem
if (!Deleted(station.Comp.Shuttle))
return;
var tradepostMap = _mapManager.CreateMap();
if (!_loader.TryLoad(tradepostMap, station.Comp.ShuttlePath.ToString(), out var shuttleUids))
if (!_loader.TryLoadMap(station.Comp.ShuttlePath, out var tradepostMap, out var shuttleUids))
return;
var shuttle = shuttleUids[0];
var shuttle = shuttleUids.First();
station.Comp.Shuttle = shuttle;
station.Comp.TradePostMap = _mapManager.GetMapEntityId(tradepostMap);
station.Comp.TradePostMap = _mapManager.GetMapEntityId(tradepostMap.Value.Comp.MapId);
var travelingStoreShipComp = EnsureComp<CP14TravelingStoreShipComponent>(station.Comp.Shuttle.Value);
travelingStoreShipComp.Station = station;

View File

@@ -5,7 +5,8 @@ using Content.Server.Station.Systems;
using Content.Shared.Maps;
using Content.Shared.Station.Components;
using Robust.Server.GameObjects;
using Robust.Server.Maps;
using Robust.Shared.EntitySerialization;
using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map;
namespace Content.Server._CP14.ZLevels.EntitySystems;
@@ -60,10 +61,9 @@ public sealed partial class CP14StationZLevelsSystem : EntitySystem
continue;
}
var path = level.Path.ToString();
if (path is null)
if (level.Path is null)
{
Log.Error($"path {path} for CP14StationZLevelsSystem at level {map} don't exist!");
Log.Error($"path {level.Path.ToString()} for CP14StationZLevelsSystem at level {map} don't exist!");
continue;
}
@@ -72,9 +72,8 @@ public sealed partial class CP14StationZLevelsSystem : EntitySystem
member.Station = ent;
Log.Info($"Created map {mapId} for CP14StationZLevelsSystem at level {map}");
var options = new MapLoadOptions { LoadMap = true };
if (!_mapLoader.TryLoad(mapId, path, out var grids, options))
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);