From cd7537768deea058fb9541c03ef8409fe7eb6825 Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Tue, 28 May 2013 01:55:33 +0000 Subject: [PATCH] road/rail deteriation: use isOverWater() instead of hard-coded numbers Note- this will allow deteriation of bridges even when there is traffic. This is a change from previous versions. git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@685 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/MapScanner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/micropolisj/engine/MapScanner.java b/src/micropolisj/engine/MapScanner.java index 32484de..24526a4 100644 --- a/src/micropolisj/engine/MapScanner.java +++ b/src/micropolisj/engine/MapScanner.java @@ -122,7 +122,7 @@ class MapScanner { if (city.roadEffect < PRNG.nextInt(32)) { - if ((cchr & 15) < 2 || (cchr & 15) == 15) + if (isOverWater(cchr)) city.setTile(xpos, ypos, RIVER); else city.setTile(xpos, ypos, (char)(RUBBLE + PRNG.nextInt(4) + BULLBIT)); @@ -256,7 +256,7 @@ class MapScanner if (PRNG.nextInt(512) == 0) { if ((cchr & CONDBIT) == 0) { if (city.roadEffect < PRNG.nextInt(32)) { - if (cchr9 < RAILBASE+2) { + if (isOverWater(cchr)) { city.setTile(xpos,ypos,RIVER); } else { city.setTile(xpos,ypos,(char)(RUBBLE + PRNG.nextInt(4)+BULLBIT));