- 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));
- if (game.damage[DSRSENS] == 0 || game.condit == IHDOCKED) {
+ game.ks[loccom] = next;
+ game.kdist[loccom] = game.kavgd[loccom] = distance(game.sector, next);
+ if (!damaged(DSRSENS) || game.condition == docked) {