forked from github/server
Merge branch 'bug-2059-force-leave' of github.com:badgerman/eressea into bug-2059-force-leave
Conflicts: src/laws.c src/laws.test.c
This commit is contained in:
commit
73e1632dee
1 changed files with 8 additions and 4 deletions
12
src/laws.c
12
src/laws.c
|
@ -4277,20 +4277,24 @@ void force_leave(region *r) {
|
||||||
unit *u;
|
unit *u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
unit *uo = NULL;
|
unit *uo = NULL;
|
||||||
message *msg = NULL;
|
|
||||||
if (u->building) {
|
if (u->building) {
|
||||||
uo = building_owner(u->building);
|
uo = building_owner(u->building);
|
||||||
msg = msg_message("force_leave_building", "unit owner building", u, uo, u->building);
|
|
||||||
}
|
}
|
||||||
if (u->ship && r->land) {
|
if (u->ship && r->land) {
|
||||||
uo = ship_owner(u->ship);
|
uo = ship_owner(u->ship);
|
||||||
msg = msg_message("force_leave_ship", "unit owner ship", u, uo, u->ship);
|
|
||||||
}
|
}
|
||||||
if (uo && !help_enter(uo, u)) {
|
if (uo && !help_enter(uo, u)) {
|
||||||
leave(u, false);
|
message *msg = NULL;
|
||||||
|
if (u->building) {
|
||||||
|
msg = msg_message("force_leave_building", "unit owner building", u, uo, u->building);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = msg_message("force_leave_ship", "unit owner ship", u, uo, u->ship);
|
||||||
|
}
|
||||||
if (msg) {
|
if (msg) {
|
||||||
ADDMSG(&u->faction->msgs, msg);
|
ADDMSG(&u->faction->msgs, msg);
|
||||||
}
|
}
|
||||||
|
leave(u, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue