Replace every usage of GridCoordinates with EntityCoordinates (#2021)
* Update RobustToolbox * Transition direct type usages * More updates * Fix invalid use of to map * Update RobustToolbox * Fix dropping items * Rename name usages of "GridCoordinates" to "EntityCoordinates" * Revert "Update RobustToolbox" This reverts commit 9f334a17c5908ded0043a63158bb671e4aa3f346. * Revert "Update RobustToolbox" This reverts commit 3a9c8cfa3606fa501aa84407796d2ad920853a09. # Conflicts: # RobustToolbox * Fix cursed IMapGrid method usage. * GridTileLookupTest now uses EntityCoordinates Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
This commit is contained in:
@@ -75,12 +75,12 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public bool InRange(GridCoordinates from, GridCoordinates to)
|
||||
public bool InRange(EntityCoordinates from, EntityCoordinates to)
|
||||
{
|
||||
return from.InRange(_mapManager, to, 15);
|
||||
return from.InRange(EntityManager, to, 15);
|
||||
}
|
||||
|
||||
public bool TryPoint(ICommonSession? session, GridCoordinates coords, EntityUid uid)
|
||||
public bool TryPoint(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||
{
|
||||
var player = (session as IPlayerSession)?.ContentData()?.Mind?.CurrentEntity;
|
||||
if (player == null)
|
||||
@@ -100,7 +100,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!InRange(coords, player.Transform.GridPosition))
|
||||
if (!InRange(coords, player.Transform.Coordinates))
|
||||
{
|
||||
player.PopupMessage(Loc.GetString("You can't reach there!"));
|
||||
return false;
|
||||
@@ -108,7 +108,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
if (ActionBlockerSystem.CanChangeDirection(player))
|
||||
{
|
||||
var diff = coords.ToMapPos(_mapManager) - player.Transform.MapPosition.Position;
|
||||
var diff = coords.ToMapPos(EntityManager) - player.Transform.MapPosition.Position;
|
||||
if (diff.LengthSquared > 0.01f)
|
||||
{
|
||||
player.Transform.LocalRotation = new Angle(diff);
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
}
|
||||
else
|
||||
{
|
||||
var tileRef = _mapManager.GetGrid(coords.GridID).GetTileRef(coords);
|
||||
var tileRef = _mapManager.GetGrid(coords.GetGridId(EntityManager)).GetTileRef(coords);
|
||||
var tileDef = _tileDefinitionManager[tileRef.Tile.TypeId];
|
||||
|
||||
selfMessage = Loc.GetString("You point at {0}.", tileDef.DisplayName);
|
||||
|
||||
Reference in New Issue
Block a user