forked from github/server
fixes for the prevF speedup
This commit is contained in:
parent
b3d22eae63
commit
d5ce48bf7f
2 changed files with 3 additions and 1 deletions
|
@ -1021,10 +1021,11 @@ u_setfaction(unit * u, faction * f)
|
|||
|
||||
if (u->nextF) u->nextF->prevF = u->prevF;
|
||||
if (u->prevF) u->prevF->nextF = u->nextF;
|
||||
else f->units = u->nextF;
|
||||
else u->faction->units = u->nextF;
|
||||
}
|
||||
|
||||
if (f!=NULL) {
|
||||
if (f->units) f->units->prevF=u;
|
||||
u->prevF = NULL;
|
||||
u->nextF = f->units;
|
||||
f->units = u;
|
||||
|
|
|
@ -185,6 +185,7 @@ region_setresource(region& r, const char * type, int value)
|
|||
rm->amount = value;
|
||||
break;
|
||||
}
|
||||
rm=rm->next;
|
||||
}
|
||||
if (!rm) {
|
||||
if (rtype==rt_find("money")) rsetmoney(&r, value);
|
||||
|
|
Loading…
Reference in a new issue