FloorTileItem station extension/new grid creation (#2500)

* FloorTileItemComponent can now extend the station, or create new grids.

* Fixes wrong interaction system EntityCoordinates check.
Needed for all this to work.
This commit is contained in:
Víctor Aguilera Puerto
2020-11-06 12:38:41 +01:00
committed by GitHub
parent 6a469508ca
commit bb3aee90b2
2 changed files with 44 additions and 13 deletions

View File

@@ -156,7 +156,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
private bool HandleWideAttack(ICommonSession session, EntityCoordinates coords, EntityUid uid)
{
// client sanitization
if (!_mapManager.GridExists(coords.GetGridId(_entityManager)))
if (!coords.IsValid(_entityManager))
{
Logger.InfoS("system.interaction", $"Invalid Coordinates: client={session}, coords={coords}");
return true;
@@ -211,7 +211,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
private bool HandleClientUseItemInHand(ICommonSession session, EntityCoordinates coords, EntityUid uid)
{
// client sanitization
if (!_mapManager.GridExists(coords.GetGridId(_entityManager)))
if (!coords.IsValid(_entityManager))
{
Logger.InfoS("system.interaction", $"Invalid Coordinates: client={session}, coords={coords}");
return true;
@@ -242,7 +242,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
private bool HandleTryPullObject(ICommonSession session, EntityCoordinates coords, EntityUid uid)
{
// client sanitization
if (!_mapManager.GridExists(coords.GetGridId(_entityManager)))
if (!coords.IsValid(_entityManager))
{
Logger.InfoS("system.interaction", $"Invalid Coordinates for pulling: client={session}, coords={coords}");
return false;
@@ -303,7 +303,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
}
// Verify player is on the same map as the entity he clicked on
if (_mapManager.GetGrid(coordinates.GetGridId(EntityManager)).ParentMapId != playerTransform.MapID)
if (coordinates.GetMapId(_entityManager) != playerTransform.MapID)
{
Logger.WarningS("system.interaction",
$"Player named {player.Name} clicked on a map he isn't located on");