diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index da196ce2f..5dea86b01 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -1302,12 +1302,29 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order /* check movement from/to oceans. * aquarian special, flying units, horses, the works */ if ((u->race->flags & RCF_FLY) == 0) { - if (fval(current->terrain, SEA_REGION) && !fval(next->terrain, SEA_REGION)) { - int moving = u->race->flags & (RCF_SWIM|RCF_WALK|RCF_COASTAL); - /* Die Einheit kann nicht fliegen, ist im Ozean, und will an Land */ - if (moving != (RCF_SWIM|RCF_WALK) && (moving|RCF_COASTAL) == 0) { - /* can't swim+walk and isn't allowed to enter coast from sea */ - if (ord!=NULL) cmistake(u, ord, 44, MSG_MOVE); + if (!fval(next->terrain, SEA_REGION)) { + /* next region is land */ + if (fval(current->terrain, SEA_REGION)) { + int moving = u->race->flags & (RCF_SWIM|RCF_WALK|RCF_COASTAL); + /* Die Einheit kann nicht fliegen, ist im Ozean, und will an Land */ + if (moving != (RCF_SWIM|RCF_WALK) && (moving|RCF_COASTAL) == 0) { + /* can't swim+walk and isn't allowed to enter coast from sea */ + if (ord!=NULL) cmistake(u, ord, 44, MSG_MOVE); + break; + } + } else if ((u->race->flags & RCF_WALK) == 0) { + /* Spezialeinheiten, die nicht laufen können. */ + int moving = u->race->flags & (RCF_SWIM|RCF_WALK|RCF_COASTAL); + ADDMSG(&u->faction->msgs, msg_message("detectocean", + "unit region", u, next)); + break; + } + } else { + /* Ozeanfelder können nur von Einheiten mit Schwimmen und ohne + * Pferde betreten werden. */ + if (!(canswim(u) || canfly(u))) { + ADDMSG(&u->faction->msgs, msg_message("detectocean", + "unit region", u, next)); break; } } @@ -1321,16 +1338,6 @@ travel_route(unit * u, region_list * route_begin, region_list * route_end, order } } - /* Ozeanfelder können nur von Einheiten mit Schwimmen und ohne - * Pferde betreten werden. */ - if (fval(next->terrain, SEA_REGION)) { - if (!(canswim(u) || canfly(u))) { - ADDMSG(&u->faction->msgs, msg_message("detectocean", - "unit region", u, next)); - break; - } - } - } /* movement blocked by a wall */ diff --git a/src/eressea/lua/unit.cpp b/src/eressea/lua/unit.cpp index d9a00e3c1..13f45b0a5 100644 --- a/src/eressea/lua/unit.cpp +++ b/src/eressea/lua/unit.cpp @@ -175,6 +175,7 @@ unit_setrace(unit& u, const char * rcname) { race * rc = rc_find(rcname); if (rc!=NULL) { + if (u.irace==u.race) u.irace = rc; u.race = rc; } }