tiles: remove old isIndustrialZone() function
Note: this old Industrial Zone checking function would erroneously include the Coal power plant animated smoke. You could see this bug by selecting "industrial zones" for the overlay map, and looking closely where your coal power plants are. You will see that the coal power plant is invisible in the overlay except for the four tiles containing the smoke. git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@816 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
14944850b7
commit
fb6db46fde
2 changed files with 6 additions and 11 deletions
|
@ -662,6 +662,11 @@ public class TileConstants
|
|||
(tile & LOMASK) < COMBASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the tile is defined with the "industrial-zone" attribute.
|
||||
* Note: the old version of this function erroneously included the coal power
|
||||
* plant smoke as an industrial zone.
|
||||
*/
|
||||
public static boolean isIndustrialZone(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
|
@ -675,14 +680,6 @@ public class TileConstants
|
|||
return false;
|
||||
}
|
||||
|
||||
public static boolean isIndustrialZoneOld(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
return (tmp >= INDBASE && tmp < PORTBASE)
|
||||
|| (tmp >= SMOKEBASE && tmp < TINYEXP)
|
||||
|| (tmp >= SMOKEBASE2 && tmp < FOOTBALLGAME1);
|
||||
}
|
||||
|
||||
public static boolean isResidentialClear(int tile)
|
||||
{
|
||||
return (tile & LOMASK) >= RESBASE && (tile & LOMASK) <= RESBASE+8;
|
||||
|
|
|
@ -105,9 +105,7 @@ public class Tiles
|
|||
static void checkTiles()
|
||||
{
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
if (TileConstants.isIndustrialZone(i) != TileConstants.isIndustrialZoneOld(i)) {
|
||||
System.err.println("industrial zone disagreement: "+i);
|
||||
}
|
||||
// do something here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue