Refactor map loading & saving

This commit is contained in:
ElectroJr
2024-12-22 15:13:10 +13:00
parent 1abe9db99c
commit 6242567aff
33 changed files with 553 additions and 362 deletions

View File

@@ -2,14 +2,11 @@ using System.Linq;
using System.Numerics;
using System.Threading.Tasks;
using Content.Server.Salvage.Magnet;
using Content.Shared.Humanoid;
using Content.Shared.Mobs.Components;
using Content.Shared.Procedural;
using Content.Shared.Radio;
using Content.Shared.Salvage.Magnet;
using Robust.Server.Maps;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Server.Salvage;
@@ -278,15 +275,10 @@ public sealed partial class SalvageSystem
case SalvageOffering wreck:
var salvageProto = wreck.SalvageMap;
var opts = new MapLoadOptions
{
Offset = new Vector2(0, 0)
};
if (!_map.TryLoad(salvMapXform.MapID, salvageProto.MapPath.ToString(), out _, opts))
if (!_loader.TryLoadGrid(salvMapXform.MapID, salvageProto.MapPath, out _))
{
Report(magnet, MagnetChannel, "salvage-system-announcement-spawn-debris-disintegrated");
_mapManager.DeleteMap(salvMapXform.MapID);
_mapSystem.DeleteMap(salvMapXform.MapID);
return;
}