TileConstants: simplify logic in isBridge()
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@726 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
6406c12c14
commit
8793847415
2 changed files with 3 additions and 4 deletions
|
@ -175,7 +175,7 @@ public abstract class Sprite
|
||||||
int t = z & LOMASK;
|
int t = z & LOMASK;
|
||||||
|
|
||||||
if (t >= TREEBASE) {
|
if (t >= TREEBASE) {
|
||||||
if (TileConstants.isBridge(z)) {
|
if (isBridge(z)) {
|
||||||
city.setTile(xpos, ypos, RIVER);
|
city.setTile(xpos, ypos, RIVER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ public abstract class Sprite
|
||||||
city.makeExplosion(xpos, ypos);
|
city.makeExplosion(xpos, ypos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TileConstants.checkWet(t)) {
|
if (checkWet(t)) {
|
||||||
city.setTile(xpos, ypos, RIVER);
|
city.setTile(xpos, ypos, RIVER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -293,8 +293,7 @@ public class TileConstants
|
||||||
//used by Sprite::destroyTile
|
//used by Sprite::destroyTile
|
||||||
public static boolean isBridge(int tile)
|
public static boolean isBridge(int tile)
|
||||||
{
|
{
|
||||||
return (((tile & LOMASK) >= ROADBASE && (tile & LOMASK) <= LASTROAD)
|
return isRoad(tile) && !isCombustible(tile);
|
||||||
&& !isCombustible(tile));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isCombustible(int tile)
|
public static boolean isCombustible(int tile)
|
||||||
|
|
Reference in a new issue