Bonus: avoids "may be used uninitialized" compiler warnings (the code
was safe despite the warning).
int n;
int biggest;
int civs;
- int nowned;
coord ret_x, ret_y;
coord bx, by;
struct sctstr sect;
* owner. Charge mob..
*/
biggest = -1;
- nowned = 0;
for (n = 1; n <= 6; ++n) {
ret_x = llp->unit.land.lnd_x + diroff[n][0];
ret_y = llp->unit.land.lnd_y + diroff[n][1];
mobcost = lnd_mobcost(&llp->unit.land, §);
if (mobcost < 0)
continue;
- ++nowned;
civs = sect.sct_item[I_CIVIL];
if (civs > biggest) {
biggest = civs;
bmcost = mobcost;
}
}
- if (!nowned)
+ if (biggest < 0)
nowhere_to_go = 1;
else {
/* retreat to bx,by */