TileConstants: impl isIndestructible2(), slightly different than isIndestructible()

the difference is whether RUBBLE is included or not;
TODO- make a better name

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@799 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-08-24 21:04:36 +00:00
parent aa40fc8760
commit 51973f75bd
2 changed files with 9 additions and 2 deletions

View file

@ -503,8 +503,7 @@ class MapScanner
{
for (int x = xpos-1; x <= xpos+1; x++)
{
char c = (char)(city.map[y][x] & LOMASK);
if (c >= FLOOD && c < ROADBASE) {
if (isIndestructible2(city.getTile(x,y))) {
// radioactive, on fire, or flooded
return false;
}

View file

@ -336,12 +336,20 @@ public class TileConstants
return (tmp >= FIREBASE && tmp < ROADBASE);
}
/** Used in repairZone(). */
public static boolean isIndestructible(int tile)
{
int tmp = tile & LOMASK;
return tmp >= RUBBLE && tmp < ROADBASE;
}
/** Used in zonePlop(). */
public static boolean isIndestructible2(int tile)
{
int tmp = tile & LOMASK;
return tmp >= FLOOD && tmp < ROADBASE;
}
public static boolean isRadioactive(int tile)
{
int tmp = tile & LOMASK;