InteractionSystem: Fix exception when clicking around off-grid (GridCoordinates/default grid leftovers?) (#2624)
This commit is contained in:
@@ -36,7 +36,6 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class InteractionSystem : SharedInteractionSystem
|
public sealed class InteractionSystem : SharedInteractionSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -805,7 +804,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
|||||||
private void DoAttack(IEntity player, EntityCoordinates coordinates, bool wideAttack, EntityUid target = default)
|
private void DoAttack(IEntity player, EntityCoordinates coordinates, bool wideAttack, EntityUid target = default)
|
||||||
{
|
{
|
||||||
// Verify player is on the same map as the entity he clicked on
|
// Verify player is on the same map as the entity he clicked on
|
||||||
if (_mapManager.GetGrid(coordinates.GetGridId(EntityManager)).ParentMapId != player.Transform.MapID)
|
if (coordinates.GetMapId(EntityManager) != player.Transform.MapID)
|
||||||
{
|
{
|
||||||
Logger.WarningS("system.interaction",
|
Logger.WarningS("system.interaction",
|
||||||
$"Player named {player.Name} clicked on a map he isn't located on");
|
$"Player named {player.Name} clicked on a map he isn't located on");
|
||||||
|
|||||||
Reference in New Issue
Block a user