Ranged weapon firing does not depend on DefaultGrid anymore.
This commit is contained in:
@@ -11,6 +11,7 @@ using Robust.Shared.Input;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.Interfaces.Timing;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
@@ -96,9 +97,13 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
var worldPos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition);
|
||||
|
||||
if (!_mapManager.TryFindGridAt(worldPos, out var grid))
|
||||
grid = _mapManager.GetDefaultGrid(worldPos.MapId);
|
||||
|
||||
weapon.SyncFirePos(grid.MapToGrid(worldPos));
|
||||
{
|
||||
weapon.SyncFirePos(GridId.Invalid, worldPos.Position);
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon.SyncFirePos(grid.Index, grid.MapToGrid(worldPos).Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user