Remove default grids (content) (#2241)
* Default grids go poof * Address review * Update submodule * Fix DoAfterSystem for entities without grid. * Fix SubFloorHideSystem for entities without grid. * Fix ExplosionHelper for coordinates that aren't in a grid * Fix TurfHelpers' GetWorldTileBox crash in the case of invalid grid * Fix tile prying component crash when trying to pry space. * Spill fixes when passing coordinates without grids. * Are you static'in, son? * Change SaveLoadSaveTest grid Id hardcoded value It's still hardcoded, but at least now it's correct! * Only send debug AI thing if grid is not invalid * Update submodule. Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
committed by
GitHub
parent
78507ac9a2
commit
48841a274d
@@ -187,21 +187,17 @@ namespace Content.Shared.Maps
|
||||
private static Box2 GetWorldTileBox(TileRef turf)
|
||||
{
|
||||
var map = IoCManager.Resolve<IMapManager>();
|
||||
var tileGrid = map.GetGrid(turf.GridIndex);
|
||||
|
||||
// This is scaled to 90 % so it doesn't encompass walls on other tiles.
|
||||
var tileBox = Box2.UnitCentered.Scale(tileGrid.TileSize).Scale(0.9f);
|
||||
return tileBox.Translated(tileGrid.GridTileToWorldPos(turf.GridIndices));
|
||||
}
|
||||
var tileBox = Box2.UnitCentered.Scale(0.9f);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a box the size of a tile.
|
||||
/// </summary>
|
||||
private static Box2 GetTileBox(this TileRef turf)
|
||||
{
|
||||
var map = IoCManager.Resolve<IMapManager>();
|
||||
var tileGrid = map.GetGrid(turf.GridIndex);
|
||||
return Box2.UnitCentered.Scale(tileGrid.TileSize);
|
||||
if (map.TryGetGrid(turf.GridIndex, out var tileGrid))
|
||||
{
|
||||
tileBox = tileBox.Scale(tileGrid.TileSize);
|
||||
return tileBox.Translated(tileGrid.GridTileToWorldPos(turf.GridIndices));
|
||||
}
|
||||
|
||||
return tileBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user