From b58303211f6c1f0b1c81e27856bfc39cad27dda3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 16 Oct 2005 20:45:30 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D72?= =?UTF-8?q?8=20Stra=C3=9Fe=20Richtung=20Ozean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit man kann Richtung Ozean nicht mehr bauen. --- src/common/kernel/build.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index 545d46bfd..860c29262 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -454,6 +454,9 @@ void build_road(region * r, unit * u, int size, direction_t d) { int n, left; + region * rn = rconnect(r,d); + terrain_t rt = T_OCEAN; + if (rn) rt = rterrain(rn); if (!eff_skill(u, SK_ROAD_BUILDING, r)) { cmistake(u, u->thisorder, 103, MSG_PRODUCE); @@ -464,12 +467,18 @@ build_road(region * r, unit * u, int size, direction_t d) return; } - if (terrain[rterrain(r)].roadreq < 0) { + if (terrain[rt].roadreq < 0) { cmistake(u, u->thisorder, 94, MSG_PRODUCE); return; } - if (rterrain(r) == T_SWAMP) { + rt = rterrain(r); + if (terrain[rt].roadreq < 0) { + cmistake(u, u->thisorder, 94, MSG_PRODUCE); + return; + } + + if (rt == T_SWAMP) { /* wenn kein Damm existiert */ static const struct building_type * bt_dam; if (!bt_dam) bt_dam = bt_find("dam"); @@ -478,8 +487,7 @@ build_road(region * r, unit * u, int size, direction_t d) cmistake(u, u->thisorder, 132, MSG_PRODUCE); return; } - } - if (rterrain(r) == T_DESERT) { + } else if (rt == T_DESERT) { static const struct building_type * bt_caravan; if (!bt_caravan) bt_caravan = bt_find("caravan"); assert(bt_caravan); @@ -488,8 +496,7 @@ build_road(region * r, unit * u, int size, direction_t d) cmistake(u, u->thisorder, 133, MSG_PRODUCE); return; } - } - if (rterrain(r) == T_GLACIER) { + } else if (rt == T_GLACIER) { static const struct building_type * bt_tunnel; if (!bt_tunnel) bt_tunnel = bt_find("tunnel"); assert(bt_tunnel); @@ -505,7 +512,7 @@ build_road(region * r, unit * u, int size, direction_t d) } /* left kann man noch bauen */ - left = terrain[rterrain(r)].roadreq - rroad(r, d); + left = terrain[rt].roadreq - rroad(r, d); /* hoffentlich ist r->road <= terrain[rterrain(r)].roadreq, n also >= 0 */ if (left <= 0) { sprintf(buf, "In %s gibt es keine Brücken und Straßen "