/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* laun.c: Launch missiles from land or sea
- *
+ *
* Known contributors to this file:
* Dave Pare, 1986
* Ken Stevens, 1995
}
}
- if (plane.pln_effic < 40) {
+ if (plane.pln_effic < 40) {
pr("%s is damaged (%d%%)\n", prplane(&plane), plane.pln_effic);
continue;
}
return RET_FAIL;
}
goodtarget = 0;
- snxtitem_dist(&ni, EF_PLANE, sx, sy, 0);
+ snxtitem_xy(&ni, EF_PLANE, sx, sy);
while (!goodtarget && nxtitem(&ni, &plane)) {
if (!plane.pln_own)
continue;
i = pp->pln_tech + pp->pln_effic;
if (chance(1.0 - (i / (i + 50.0)))) {
dir = (random() % 6) + 1;
- sx += diroff[dir][0];
- sy += diroff[dir][1];
+ sx = xnorm(sx + diroff[dir][0]);
+ sy = ynorm(sy + diroff[dir][1]);
pr("Your trajectory was a little off.\n");
}
nreport(player->cnum, N_LAUNCH, 0, 1);