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
1 changed files with 5 additions and 2 deletions
|
@ -438,9 +438,12 @@ 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->num_units;
|
||||||
|
if (u->faction->units == u) {
|
||||||
u->faction->units = u->nextF;
|
u->faction->units = u->nextF;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (u->prevF) {
|
if (u->prevF) {
|
||||||
u->prevF->nextF = u->nextF;
|
u->prevF->nextF = u->nextF;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue