/* See if we should ram ship */
if (game.quad[lookx][looky] == game.ship &&
(ienm == IHC || ienm == IHS)) {
- ram(1, ienm, com);
+ ram(true, ienm, com);
return;
}
if (krawlx != mx && my != 0) {
/* it moved */
game.ks[loccom].x = next.x;
game.ks[loccom].y = next.y;
- game.kdist[loccom] = game.kavgd[loccom] =
- sqrt(square(game.sector.x-next.x)+square(game.sector.y-next.y));
+ game.kdist[loccom] = game.kavgd[loccom] = distance(game.sector, next);
if (!damaged(DSRSENS) || game.condit == IHDOCKED) {
proutn("***");
cramen(ienm);
sc = game.state.kscmdr;
for_starbases(i) {
basetbl[i] = i;
- ibq.x = game.state.baseq[i].x;
- ibq.y = game.state.baseq[i].y;
- bdist[i] = sqrt(square(ibq.x-sc.x) + square(ibq.y-sc.y));
+ bdist[i] = distance(game.state.baseq[i], sc);
}
if (game.state.rembase > 1) {
/* sort into nearest first order */
/* move the Tholian */
{
int idx, idy, im, i;
- coord dummy;
/* Move the Tholian */
if (!game.ithere || game.justin) return;
}
/* All plugged up -- Tholian splits */
game.quad[game.tholian.x][game.tholian.y]=IHWEB;
- dropin(IHBLANK, &dummy);
+ dropin(IHBLANK);
crmena(true, IHT, sector, game.tholian);
prout(_(" completes web."));
game.ithere = false;