Skip to content
Snippets Groups Projects
Commit b8bbbbe4 authored by Julian Thijssen's avatar Julian Thijssen
Browse files

Fix bugs in abstraction

parent 0c3789bc
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ public class CoastlineAgent
private bool PositionInBounds(Vector2 pos)
{
return pos.x >= 0 || pos.y >= 0 || pos.x <= (coastlineGenerator.TerrainSize - 1) || pos.y <= (coastlineGenerator.TerrainSize - 1);
return !(pos.x < 0 || pos.y < 0 || pos.x > (coastlineGenerator.TerrainSize - 1) || pos.y > (coastlineGenerator.TerrainSize - 1));
}
private bool PositionOnEdge(Vector2 pos)
......@@ -209,7 +209,7 @@ public class CoastlineAgent
{
Vector2Int newPos = new Vector2Int((int) (oldPos.x + prefDirection.x), (int) (oldPos.y + prefDirection.y));
if (!PositionInBounds(pos)) return pos;
if (!PositionInBounds(newPos)) return pos;
if(!coastlineGenerator.landBitField[newPos.x, newPos.y])
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment