From 482a39db6d56fa703991fa3dcba040c614bb2061 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 11 Sep 2010 19:30:00 -0700 Subject: [PATCH] prevent buildings in regions that should not have any (simple hack) --- res/messages.xml | 6 +++--- src/kernel/build.c | 5 +++++ src/kernel/terrain.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/res/messages.xml b/res/messages.xml index 533ec1418..443f98785 100644 --- a/res/messages.xml +++ b/res/messages.xml @@ -4759,8 +4759,8 @@ - "$unit($unit) in $region($region): '$order($command)' - So etwas kann man nicht bauen." - "$unit($unit) in $region($region): '$order($command)' - You cannot build such a thing." + "$unit($unit) in $region($region): '$order($command)' - So etwas kann man hier nicht bauen." + "$unit($unit) in $region($region): '$order($command)' - You cannot build this here." @@ -4769,7 +4769,7 @@ "$unit($unit) in $region($region): '$order($command)' - Im astralen Nebel konnte niemand entdeckt werden." - "$unit($unit) in $region($region): '$order($command)' - Noone could be seen in th astral fog." + "$unit($unit) in $region($region): '$order($command)' - Noone could be seen in the astral fog." diff --git a/src/kernel/build.c b/src/kernel/build.c index 50ab584c4..cd70206ff 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -873,6 +873,11 @@ build_building(unit * u, const building_type * btype, int want, order * ord) cmistake(u, ord, 221, MSG_PRODUCE); return; } + if (r->terrain->max_road<=0) { + /* special terrain, cannot build */ + cmistake(u, ord, 221, MSG_PRODUCE); + return; + } if (btype->flags & BTF_ONEPERTURN) { if(b && fval(b, BLD_EXPANDED)) { cmistake(u, ord, 318, MSG_PRODUCE); diff --git a/src/kernel/terrain.h b/src/kernel/terrain.h index 644a0e329..b8be715f4 100644 --- a/src/kernel/terrain.h +++ b/src/kernel/terrain.h @@ -23,7 +23,7 @@ extern "C" { #endif /* diverse Flags */ -/* Strassen können gebaut werden, wenn max_road > 0 */ +/* Strassen und Gebäude können gebaut werden, wenn max_road > 0 */ #define LAND_REGION (1<<0) /* Standard-Land-struct region */ #define SEA_REGION (1<<1) /* hier braucht man ein Boot */ #define FOREST_REGION (1<<2) /* Elfen- und Kampfvorteil durch Bäume */