X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=ai.c;h=d96f747315ebac25962de011493f328d814a85c8;hb=665b7ab04d99076511156ac4da537f0fa144d268;hp=33e4873f52b10a2ec83ced9e0280389980108988;hpb=797f0f77ccdfd001fff39396ceae760478c2b920;p=super-star-trek.git diff --git a/ai.c b/ai.c index 33e4873..d96f747 100644 --- a/ai.c +++ b/ai.c @@ -185,10 +185,10 @@ static void movebaddy(int comx, int comy, int loccom, int ienm) 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 */ @@ -370,8 +370,8 @@ void scom(int *ipage) { 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");