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:
parent
aa40fc8760
commit
51973f75bd
2 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Reference in a new issue