forked from github/server
"Durch TRANSPORTIERE wurden alle Steuereinnahmen aus der Region getragen" checking for can_leave if unit is transported.
This commit is contained in:
parent
ac4f84fc8b
commit
f36265a0bb
2 changed files with 32 additions and 22 deletions
|
@ -1980,8 +1980,15 @@ travel_i(unit * u, const region_list * route_begin, const region_list * route_en
|
|||
skip_token();
|
||||
ut = getunit(r, u->faction);
|
||||
if (ut!=NULL) {
|
||||
if (get_keyword(ut->thisorder) == K_DRIVE) {
|
||||
if (ut->building && !can_leave(ut)) {
|
||||
cmistake(ut, ut->thisorder, 150, MSG_MOVE);
|
||||
cmistake(u, ord, 99, MSG_MOVE);
|
||||
} else if (!can_move(ut)) {
|
||||
cmistake(u, ord, 99, MSG_MOVE);
|
||||
} else {
|
||||
boolean found = false;
|
||||
if (get_keyword(ut->thisorder) == K_DRIVE && can_move(ut)) {
|
||||
|
||||
if (!fval(ut, UFL_NOTMOVING) && !LongHunger(ut)) {
|
||||
init_tokens(ut->thisorder);
|
||||
skip_token();
|
||||
|
@ -2003,8 +2010,7 @@ travel_i(unit * u, const region_list * route_begin, const region_list * route_en
|
|||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cmistake(u, ord, 99, MSG_MOVE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
|
|
|
@ -890,7 +890,11 @@ move_unit(unit * u, region * r, unit ** ulist)
|
|||
if (u->region) {
|
||||
setguard(u, GUARD_NONE);
|
||||
fset(u, UFL_MOVED);
|
||||
if (u->ship || u->building) leave(u, true);
|
||||
if (u->ship || u->building) {
|
||||
/* can_leave must be checked in travel_i */
|
||||
boolean result = leave(u, false);
|
||||
assert(result);
|
||||
}
|
||||
translist(&u->region->units, ulist, u);
|
||||
} else {
|
||||
addlist(ulist, u);
|
||||
|
|
Loading…
Reference in a new issue