forked from github/server
integration of the separate if-conditions and simplification of the loop
This commit is contained in:
parent
153db447de
commit
2fe95f3d61
|
@ -529,16 +529,11 @@ void drown(region * r)
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
|
|
||||||
if (u->ship || u_race(u) == get_race(RC_SPELL) || u->number == 0) {
|
if (!(u->ship || u_race(u) == get_race(RC_SPELL) || u->number == 0 || canswim(u) || canfly(u))) {
|
||||||
up = &u->next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(canswim(u) || canfly(u))) {
|
|
||||||
scale_number(u, 0);
|
scale_number(u, 0);
|
||||||
ADDMSG(&u->faction->msgs, msg_message("drown", "unit region", u, r));
|
ADDMSG(&u->faction->msgs, msg_message("drown", "unit region", u, r));
|
||||||
}
|
}
|
||||||
if (*up == u)
|
|
||||||
up = &u->next;
|
up = &u->next;
|
||||||
}
|
}
|
||||||
remove_empty_units_in_region(r);
|
remove_empty_units_in_region(r);
|
||||||
|
|
Loading…
Reference in New Issue