Replace obsolete Tile Access methods (#32508)

* Replace obsolete SetTile

* Remove obsolete GetTileRef & GetAllTiles

* Forgor

* Apply suggested `GetMapOrInvalid`
This commit is contained in:
MilenVolf
2024-09-29 02:27:47 +03:00
committed by GitHub
parent 0a7b23cd4d
commit 1b9d77a760
18 changed files with 59 additions and 40 deletions

View File

@@ -1,8 +1,6 @@
using System.Threading.Tasks;
using Content.Server.Administration;
using Content.Shared.Administration;
using Content.Shared.Procedural;
using Content.Shared.Procedural.DungeonGenerators;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -44,7 +42,7 @@ public sealed partial class DungeonSystem
}
var position = new Vector2i(posX, posY);
var dungeonUid = _mapManager.GetMapEntityId(mapId);
var dungeonUid = _maps.GetMapOrInvalid(mapId);
if (!TryComp<MapGridComponent>(dungeonUid, out var dungeonGrid))
{
@@ -118,7 +116,7 @@ public sealed partial class DungeonSystem
}
var mapId = new MapId(mapInt);
var mapUid = _mapManager.GetMapEntityId(mapId);
var mapUid = _maps.GetMapOrInvalid(mapId);
if (!_prototype.TryIndex<DungeonRoomPackPrototype>(args[1], out var pack))
{
@@ -156,7 +154,7 @@ public sealed partial class DungeonSystem
}
}
grid.SetTiles(tiles);
_maps.SetTiles(mapUid, grid, tiles);
shell.WriteLine(Loc.GetString("cmd-dungen_pack_vis"));
}
@@ -174,7 +172,7 @@ public sealed partial class DungeonSystem
}
var mapId = new MapId(mapInt);
var mapUid = _mapManager.GetMapEntityId(mapId);
var mapUid =_maps.GetMapOrInvalid(mapId);
if (!_prototype.TryIndex<DungeonPresetPrototype>(args[1], out var preset))
{
@@ -197,7 +195,7 @@ public sealed partial class DungeonSystem
}
}
grid.SetTiles(tiles);
_maps.SetTiles(mapUid, grid, tiles);
shell.WriteLine(Loc.GetString("cmd-dungen_pack_vis"));
}