bugfix: check map boundry in traffic gen

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@574 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-24 01:19:11 +00:00
parent 3cfb63272a
commit 5219c6f1be

View file

@ -98,8 +98,7 @@ class TrafficGen
int tx = mapX + PerimX[z];
int ty = mapY + PerimY[z];
if (city.testBounds(tx, ty)
&& roadTest(tx, ty))
if (roadTest(tx, ty))
{
mapX = tx;
mapY = ty;
@ -111,6 +110,10 @@ class TrafficGen
boolean roadTest(int tx, int ty)
{
if (!city.testBounds(tx, ty)) {
return false;
}
char c = city.getTile(tx, ty);
c &= LOMASK;