diff --git a/SS14.Client/Placement/Modes/AlignSnapgridBorder.cs b/SS14.Client/Placement/Modes/AlignSnapgridBorder.cs index 04d9cec2a4f..53ce308fe7f 100644 --- a/SS14.Client/Placement/Modes/AlignSnapgridBorder.cs +++ b/SS14.Client/Placement/Modes/AlignSnapgridBorder.cs @@ -60,7 +60,7 @@ public override bool Update(ScreenCoordinates mouseS) (float)Math.Round((mouseCoords.Y / (double)snapsize), MidpointRounding.AwayFromZero) * snapsize); //Convert back to original world and screen coordinates after applying offset - mouseCoords.Position = mouselocal + new Vector2(pManager.CurrentPrototype.PlacementOffset.X, pManager.CurrentPrototype.PlacementOffset.Y); + mouseCoords = new LocalCoordinates(mouselocal + new Vector2(pManager.CurrentPrototype.PlacementOffset.X, pManager.CurrentPrototype.PlacementOffset.Y), mouseCoords.Grid); mouseScreen = CluwneLib.WorldToScreen(mouseCoords); if (!RangeCheck()) diff --git a/SS14.Shared/Map/Coordinates.cs b/SS14.Shared/Map/Coordinates.cs index 1bca5b714e1..8ec0b23fa8e 100644 --- a/SS14.Shared/Map/Coordinates.cs +++ b/SS14.Shared/Map/Coordinates.cs @@ -14,19 +14,11 @@ public struct LocalCoordinates { public readonly int GridID; public readonly int MapID; - public Vector2 Position; + public readonly Vector2 Position; - public float X - { - get => Position.X; - set => new LocalCoordinates(value, Position.Y, GridID, MapID); - } + public float X => Position.X; - public float Y - { - get => Position.Y; - set => new LocalCoordinates(Position.X, value, GridID, MapID); - } + public float Y => Position.Y; public IMap Map => IoCManager.Resolve().GetMap(MapID); @@ -90,19 +82,11 @@ public bool InRange(LocalCoordinates localpos, int range) public struct ScreenCoordinates { public readonly int MapID; - public Vector2 Position; + public readonly Vector2 Position; - public float X - { - get => Position.X; - set => new ScreenCoordinates(value, Position.Y, MapID); - } + public float X => Position.X; - public float Y - { - get => Position.Y; - set => new ScreenCoordinates(Position.X, value, MapID); - } + public float Y => Position.Y; public ScreenCoordinates(Vector2 argPosition, int argMap) {