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:
parent
3cfb63272a
commit
5219c6f1be
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Reference in a new issue