projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Yet more documenation of the history, and archiving of some ancestral versions.
[super-star-trek.git]
/
ai.c
diff --git
a/ai.c
b/ai.c
index 33e4873f52b10a2ec83ced9e0280389980108988..1e70f2a72c84f7865cdac3cf46ee27abf62d8c2c 100644
(file)
--- a/
ai.c
+++ b/
ai.c
@@
-49,7
+49,7
@@
static int tryexit(int lookx, int looky, int ienm, int loccom, int irun)
ientesc=0;
isatb=0;
game.future[FSCMOVE]=0.2777+game.state.date;
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;
}
game.state.isx=iqx;
game.state.isy=iqy;
}
@@
-185,10
+185,10
@@
static void movebaddy(int comx, int comy, int loccom, int ienm)
nextx = comx;
nexty = comy;
/* main move loop */
nextx = comx;
nexty = comy;
/* main move loop */
- for (ll =
1; ll <=
nsteps; ll++) {
+ for (ll =
0; ll <
nsteps; ll++) {
#ifdef DEBUG
if (idebug) {
#ifdef DEBUG
if (idebug) {
- prout("%d", ll);
+ prout("%d", ll
+1
);
}
#endif
/* Check if preferred position available */
}
#endif
/* Check if preferred position available */
@@
-330,7
+330,7
@@
static int movescom(int iqx, int iqy, int flag, int *ipage)
isatb=0;
ishere=0;
ientesc=0;
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;
for_local_enemies(i)
if (game.quad[game.kx[i]][game.ky[i]] == IHS) break;
game.quad[game.kx[i]][game.ky[i]] = IHDOT;
@@
-370,15
+370,15
@@
void scom(int *ipage)
{
int i, i2, j, ideltax, ideltay, ibqx, ibqy, sx, sy, ifindit, iwhichb;
int iqx, iqy;
{
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");
#endif
/* Decide on being active or passive */
int flag;
#ifdef DEBUG
if (idebug) prout("SCOM");
#endif
/* Decide on being active or passive */
- flag = ((
game.state.killc+game.state.killk
)/(game.state.date+0.01-indate) < 0.1*skill*(skill+1.0) ||
+ flag = ((
NKILLC+NKILLK
)/(game.state.date+0.01-indate) < 0.1*skill*(skill+1.0) ||
(game.state.date-indate) < 3.0);
if (iscate==0 && flag) {
/* compute move away from Enterprise */
(game.state.date-indate) < 3.0);
if (iscate==0 && flag) {
/* compute move away from Enterprise */
@@
-394,7
+394,7
@@
void scom(int *ipage)
/* compute distances to starbases */
if (game.state.rembase <= 0) {
/* nothing left to do */
/* 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;
return;
}
sx = game.state.isx;
@@
-498,7
+498,7
@@
void scom(int *ipage)
}
/* check for a base */
if (game.state.rembase == 0) {
}
/* 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];
}
else for_starbases(i) {
ibqx = game.state.baseqx[i];
@@
-509,7
+509,7
@@
void scom(int *ipage)
iseenit = 0;
isatb=1;
game.future[FSCDBAS] = game.state.date + 1.0 +2.0*Rand();
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 */
game.future[FCDBAS]-game.state.date;
if (game.damage[DRADIO] > 0 && condit != IHDOCKED)
return; /* no warning */