forked from github/server
BUG 2313: proper accounting in remove_unit.
https://bugs.eressea.de/view.php?id=2313
This commit is contained in:
parent
720c41c1bf
commit
decc38a056
|
@ -438,8 +438,11 @@ int remove_unit(unit ** ulist, unit * u)
|
||||||
*ulist = u->next;
|
*ulist = u->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u->faction && u->faction->units == u) {
|
if (u->faction) {
|
||||||
u->faction->units = u->nextF;
|
--u->faction->num_units;
|
||||||
|
if (u->faction->units == u) {
|
||||||
|
u->faction->units = u->nextF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (u->prevF) {
|
if (u->prevF) {
|
||||||
u->prevF->nextF = u->nextF;
|
u->prevF->nextF = u->nextF;
|
||||||
|
|
Loading…
Reference in New Issue