diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 79c6e875a..62eb398ea 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -1875,7 +1875,7 @@ buy(unit * u, request ** buyorders, struct order * ord) if (u->race == new_race[RC_INSECT]) { /* entweder man ist insekt, oder... */ - if (rterrain(r) != T_SWAMP && rterrain(r) != T_DESERT && !rbuildings(r)) { + if (r->terrain != newterrain(T_SWAMP) && rterrain(r) != T_DESERT && !rbuildings(r)) { cmistake(u, ord, 119, MSG_COMMERCE); return; } @@ -2165,7 +2165,7 @@ sell(unit * u, request ** sellorders, struct order * ord) /* In der Region muß es eine Burg geben. */ if (u->race == new_race[RC_INSECT]) { - if (rterrain(r) != T_SWAMP && rterrain(r) != T_DESERT && !rbuildings(r)) { + if (r->terrain != newterrain(T_SWAMP) && rterrain(r) != T_DESERT && !rbuildings(r)) { cmistake(u, ord, 119, MSG_COMMERCE); return false; } diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index fa2976642..7211e4ab2 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1379,7 +1379,7 @@ randomevents(void) set_string(&u->name, "Seeschlange"); } - if ((rterrain(r) == T_GLACIER || rterrain(r) == T_SWAMP || rterrain(r) == T_DESERT) && rand() % 10000 < (5 + 100 * chaosfactor(r))) + if ((rterrain(r) == T_GLACIER || r->terrain == newterrain(T_SWAMP) || rterrain(r) == T_DESERT) && rand() % 10000 < (5 + 100 * chaosfactor(r))) { if (chance(0.80)) { u = createunit(r, findfaction(MONSTER_FACTION), nrand(60, 20) + 1, new_race[RC_FIREDRAGON]); diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index b6b4e93f4..2e552e9fd 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -460,7 +460,6 @@ void build_road(region * r, unit * u, int size, direction_t d) { int n, left; - terrain_t rt = rterrain(r); region * rn = rconnect(r,d); if (!eff_skill(u, SK_ROAD_BUILDING, r)) { @@ -482,7 +481,7 @@ build_road(region * r, unit * u, int size, direction_t d) return; } - if (rt == T_SWAMP) { + if (r->terrain == newterrain(T_SWAMP)) { /* wenn kein Damm existiert */ static const struct building_type * bt_dam; if (!bt_dam) bt_dam = bt_find("dam"); @@ -491,7 +490,7 @@ build_road(region * r, unit * u, int size, direction_t d) cmistake(u, u->thisorder, 132, MSG_PRODUCE); return; } - } else if (rt == T_DESERT) { + } else if (r->terrain == newterrain(T_DESERT)) { static const struct building_type * bt_caravan; if (!bt_caravan) bt_caravan = bt_find("caravan"); assert(bt_caravan); @@ -500,7 +499,7 @@ build_road(region * r, unit * u, int size, direction_t d) cmistake(u, u->thisorder, 133, MSG_PRODUCE); return; } - } else if (rt == T_GLACIER) { + } else if (r->terrain == newterrain(T_GLACIER)) { static const struct building_type * bt_tunnel; if (!bt_tunnel) bt_tunnel = bt_find("tunnel"); assert(bt_tunnel); diff --git a/src/common/kernel/skill.c b/src/common/kernel/skill.c index 17c9767f1..c0346aad1 100644 --- a/src/common/kernel/skill.c +++ b/src/common/kernel/skill.c @@ -176,15 +176,14 @@ skill_mod(const race * rc, skill_t sk, const struct terrain_type * terrain) if (rc == new_race[RC_DWARF]) { if (sk==SK_TACTICS) { - terrain_t t = oldterrain(terrain); - if (t == T_MOUNTAIN || t == T_GLACIER || t == T_ICEBERG_SLEEP) ++result; + if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION)) + ++result; } } else if (rc == new_race[RC_INSECT]) { - terrain_t t = oldterrain(terrain); - if (t == T_MOUNTAIN || t == T_GLACIER || t == T_ICEBERG_SLEEP || t == T_ICEBERG) + if (terrain == newterrain(T_MOUNTAIN) || fval(terrain, ARCTIC_REGION)) --result; - else if (t == T_DESERT || t == T_SWAMP) + else if (terrain == newterrain(T_DESERT) || terrain == newterrain(T_SWAMP)) ++result; } diff --git a/src/common/kernel/terrain.c b/src/common/kernel/terrain.c index ad323d7a7..4884d7f3e 100644 --- a/src/common/kernel/terrain.c +++ b/src/common/kernel/terrain.c @@ -138,7 +138,7 @@ init_terrains(void) if (newterrain!=NULL) { newterrains[t] = newterrain; } else { - log_error(("missing classic terrain %s\n", terraindata[t])); + log_warning(("missing classic terrain %s\n", terraindata[t])); } } } diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index acf3e5c47..b683ae40c 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -565,7 +565,6 @@ race_compat(void) } } else { log_error(("could not find old race %s\n", oldracenames[i])); - assert(rc); } } } diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index a587dbb8c..806c5e2b0 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -1523,7 +1523,7 @@ sp_create_irongolem(castorder *co) int number = lovar(force*8*RESOURCE_QUANTITY); if (number<1) number = 1; - if (rterrain(r) == T_SWAMP) { + if (r->terrain == newterrain(T_SWAMP)) { cmistake(mage, co->order, 188, MSG_MAGIC); return 0; } @@ -1585,7 +1585,7 @@ sp_create_stonegolem(castorder *co) int number = lovar(co->force*5*RESOURCE_QUANTITY); if (number<1) number = 1; - if (rterrain(r) == T_SWAMP) { + if (r->terrain == newterrain(T_SWAMP)) { cmistake(mage, co->order, 188, MSG_MAGIC); return 0; } @@ -1724,7 +1724,7 @@ sp_great_drought(castorder *co) cansee(u->faction, r, mage, 0)? unitname(mage) : "Jemand", regionname(r, u->faction)); if (!fval(r->terrain, SEA_REGION)){ - if(rterrain(r) == T_SWAMP && terraform){ + if (r->terrain == newterrain(T_SWAMP) && terraform) { scat(" Eis schmilzt und verwandelt sich in Morast. Reißende " "Ströme spülen die mageren Felder weg und ersäufen " "Mensch und Tier. Was an Bauten nicht den Fluten zum Opfer " @@ -2676,7 +2676,7 @@ sp_summondragon(castorder *co) f = findfaction(MONSTER_FACTION); - if(rterrain(r) != T_SWAMP && rterrain(r) != T_DESERT + if (r->terrain != newterrain(T_SWAMP) && rterrain(r) != T_DESERT && rterrain(r) != T_GLACIER){ report_failure(mage, co->order); return 0; diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 9e1d582cd..663dee3d8 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -687,7 +687,7 @@ road_decay(void) for (r=regions;r;r=r->next) { boolean half = false; - if (rterrain(r) == T_SWAMP) { + if (r->terrain == newterrain(T_SWAMP)) { /* wenn kein Damm existiert */ if (!buildingtype_exists(r, bt_dam)) { half = true; diff --git a/src/eressea/server.cpp b/src/eressea/server.cpp index b23e99797..a9519e0be 100644 --- a/src/eressea/server.cpp +++ b/src/eressea/server.cpp @@ -457,23 +457,23 @@ usage(const char * prog, const char * arg) static void setLuaString(lua_State * luaState, const char * name, const char * value) { -#ifdef LUBIND_OLD - luabind::object globals = luabind::get_globals(luaState); +#ifdef LUABIND_OLD + luabind::object g = luabind::get_globals(luaState); #else - luabind::object globals = luabind::globals(luaState); + luabind::object g = luabind::globals(luaState); #endif - globals[name] = value; + g[name] = value; } static void setLuaNumber(lua_State * luaState, const char * name, double value) { -#if BOOST_VERSION > 103002 - luabind::object globals = luabind::globals(luaState); +#ifdef LUABIND_OLD + luabind::object g = luabind::get_globals(luaState); #else - luabind::object globals = luabind::get_globals(luaState); + luabind::object g = luabind::globals(luaState); #endif - globals[name] = value; + g[name] = value; } static int