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:
jason@long.name 2013-07-07 14:11:02 +00:00
parent 6406c12c14
commit 8793847415
2 changed files with 3 additions and 4 deletions

View file

@ -175,7 +175,7 @@ public abstract class Sprite
int t = z & LOMASK;
if (t >= TREEBASE) {
if (TileConstants.isBridge(z)) {
if (isBridge(z)) {
city.setTile(xpos, ypos, RIVER);
return;
}
@ -188,7 +188,7 @@ public abstract class Sprite
city.makeExplosion(xpos, ypos);
}
}
if (TileConstants.checkWet(t)) {
if (checkWet(t)) {
city.setTile(xpos, ypos, RIVER);
}
else {

View file

@ -293,8 +293,7 @@ public class TileConstants
//used by Sprite::destroyTile
public static boolean isBridge(int tile)
{
return (((tile & LOMASK) >= ROADBASE && (tile & LOMASK) <= LASTROAD)
&& !isCombustible(tile));
return isRoad(tile) && !isCombustible(tile);
}
public static boolean isCombustible(int tile)