fixes for the prevF speedup

This commit is contained in:
Enno Rehling 2008-06-09 23:39:15 +00:00
parent b3d22eae63
commit d5ce48bf7f
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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);