Update content to mapsystem (#12387)

This commit is contained in:
metalgearsloth
2022-11-13 17:47:48 +11:00
committed by GitHub
parent 9f5c3318c9
commit 6ab864fcda
16 changed files with 70 additions and 62 deletions

View File

@@ -1,5 +1,4 @@
using System.Linq;
using Robust.Server.Maps;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Map;
using Robust.Shared.Network;
@@ -11,8 +10,8 @@ namespace Content.Server.Administration.Systems;
/// </summary>
public sealed class AdminTestArenaSystem : EntitySystem
{
[Dependency] private readonly IMapLoader _mapLoader = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly MapLoaderSystem _map = default!;
public const string ArenaMapPath = "/Maps/Test/admin_test_arena.yml";
@@ -35,7 +34,7 @@ public sealed class AdminTestArenaSystem : EntitySystem
}
ArenaMap[admin.UserId] = _mapManager.GetMapEntityId(_mapManager.CreateMap());
var (_, grids) = _mapLoader.LoadMap(Comp<MapComponent>(ArenaMap[admin.UserId]).WorldMap, ArenaMapPath);
var grids = _map.LoadMap(Comp<MapComponent>(ArenaMap[admin.UserId]).WorldMap, ArenaMapPath);
ArenaGrid[admin.UserId] = grids.Count == 0 ? null : grids[0];
return (ArenaMap[admin.UserId], ArenaGrid[admin.UserId]);