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,9 +438,12 @@ int remove_unit(unit ** ulist, unit * u)
|
|||
*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;
|
||||
}
|
||||
}
|
||||
if (u->prevF) {
|
||||
u->prevF->nextF = u->nextF;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue