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->nextF) u->nextF->prevF = u->prevF;
|
||||||
if (u->prevF) u->prevF->nextF = u->nextF;
|
if (u->prevF) u->prevF->nextF = u->nextF;
|
||||||
else f->units = u->nextF;
|
else u->faction->units = u->nextF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f!=NULL) {
|
if (f!=NULL) {
|
||||||
|
if (f->units) f->units->prevF=u;
|
||||||
u->prevF = NULL;
|
u->prevF = NULL;
|
||||||
u->nextF = f->units;
|
u->nextF = f->units;
|
||||||
f->units = u;
|
f->units = u;
|
||||||
|
|
|
@ -185,6 +185,7 @@ region_setresource(region& r, const char * type, int value)
|
||||||
rm->amount = value;
|
rm->amount = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
rm=rm->next;
|
||||||
}
|
}
|
||||||
if (!rm) {
|
if (!rm) {
|
||||||
if (rtype==rt_find("money")) rsetmoney(&r, value);
|
if (rtype==rt_find("money")) rsetmoney(&r, value);
|
||||||
|
|
Loading…
Reference in a new issue