overlay-map: add sanity check for tile value before indexing a tile
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@605 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
19a3fcefd7
commit
1bbc20487f
1 changed files with 5 additions and 0 deletions
|
@ -325,7 +325,11 @@ public class OverlayMapView extends JComponent
|
|||
default:
|
||||
}
|
||||
|
||||
// tile == -1 means it's already been drawn
|
||||
// in the checkPower function
|
||||
|
||||
if (tile != -1) {
|
||||
if (tile >= 0 && tile <= LAST_TILE) {
|
||||
for (int yy = 0; yy < TILE_HEIGHT; yy++)
|
||||
{
|
||||
for (int xx = 0; xx < TILE_WIDTH; xx++)
|
||||
|
@ -335,6 +339,7 @@ public class OverlayMapView extends JComponent
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue