tool-effect: treat tiles outside of city boundary as dirt

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@892 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-12-06 02:48:06 +00:00
parent 2c517c476b
commit 721e135fee
2 changed files with 4 additions and 1 deletions

View file

@ -42,7 +42,9 @@ class ToolEffect implements ToolEffectIfc
return city.getTile(originX + dx, originY + dy);
}
else {
return CLEAR;
// tiles outside city's boundary assumed to be
// tile #0 (dirt).
return 0;
}
}

View file

@ -12,6 +12,7 @@ public interface ToolEffectIfc
{
/**
* Gets the tile at a relative location.
* @return a non-negative tile identifier
*/
int getTile(int dx, int dy);