diff --git a/Ambermoon.Core/Render/Player2D.cs b/Ambermoon.Core/Render/Player2D.cs index ded037dc..65398374 100644 --- a/Ambermoon.Core/Render/Player2D.cs +++ b/Ambermoon.Core/Render/Player2D.cs @@ -32,7 +32,7 @@ public bool Move(int x, int y, uint ticks, CharacterDirection? prevDirection = n if (!map.IsWorldMap) { // Each map should have a border of 1 (walls) - if (newX < 1 || newY < 1 || newX >= map.Width - 1 || newY >= map.Height - 1) + if (newX < 0 || newY < -1 || newX >= map.Width || newY >= map.Height - 1) canMove = false; } else @@ -41,14 +41,6 @@ public bool Move(int x, int y, uint ticks, CharacterDirection? prevDirection = n newX += map.Width; while (newY < 0) newY += map.Height; - - if (!Map.Map.IsWorldMap) - { - while (newX >= map.Width) - newX -= map.Width; - while (newY >= map.Height) - newY -= map.Height; - } } var tile = Map[(uint)newX, (uint)newY + 1];