ientesc=0;
isatb=0;
game.future[FSCMOVE]=0.2777+game.state.date;
- game.future[FSCDBAS]=1e30;
+ game.future[FSCDBAS]=FOREVER;
game.state.isx=iqx;
game.state.isy=iqy;
}
nextx = comx;
nexty = comy;
/* main move loop */
- for (ll = 1; ll <= nsteps; ll++) {
+ for (ll = 0; ll < nsteps; ll++) {
#ifdef DEBUG
if (idebug) {
- prout("%d", ll);
+ prout("%d", ll+1);
}
#endif
/* Check if preferred position available */
isatb=0;
ishere=0;
ientesc=0;
- game.future[FSCDBAS]=1e30;
+ game.future[FSCDBAS]=FOREVER;
for_local_enemies(i)
if (game.quad[game.kx[i]][game.ky[i]] == IHS) break;
game.quad[game.kx[i]][game.ky[i]] = IHDOT;
{
int i, i2, j, ideltax, ideltay, ibqx, ibqy, sx, sy, ifindit, iwhichb;
int iqx, iqy;
- int basetbl[BASEMAX];
- double bdist[BASEMAX];
+ int basetbl[BASEMAX+1];
+ double bdist[BASEMAX+1];
int flag;
#ifdef DEBUG
if (idebug) prout("SCOM");
/* compute distances to starbases */
if (game.state.rembase <= 0) {
/* nothing left to do */
- game.future[FSCMOVE] = 1e30;
+ game.future[FSCMOVE] = FOREVER;
return;
}
sx = game.state.isx;
}
/* check for a base */
if (game.state.rembase == 0) {
- game.future[FSCMOVE] = 1e30;
+ game.future[FSCMOVE] = FOREVER;
}
else for_starbases(i) {
ibqx = game.state.baseqx[i];
iseenit = 0;
isatb=1;
game.future[FSCDBAS] = game.state.date + 1.0 +2.0*Rand();
- if (game.future[FCDBAS] < 1e30) game.future[FSCDBAS] +=
+ if (game.future[FCDBAS] < FOREVER) game.future[FSCDBAS] +=
game.future[FCDBAS]-game.state.date;
if (game.damage[DRADIO] > 0 && condit != IHDOCKED)
return; /* no warning */