]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/laun.c
Update copyright notice
[empserver] / src / lib / commands / laun.c
index 01d03c0543f3ba9d312e21e9414a01a7ce9800e4..2cc523ce830e66434202e04a9b98b5631094e2e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  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
@@ -26,7 +26,7 @@
  *  ---
  *
  *  laun.c: Launch missiles from land or sea
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Ken Stevens, 1995
@@ -93,7 +93,7 @@ laun(void)
            }
        }
 
-       if (plane.pln_effic < 60) {
+       if (plane.pln_effic < 40) {
            pr("%s is damaged (%d%%)\n", prplane(&plane), plane.pln_effic);
            continue;
        }
@@ -158,7 +158,7 @@ launch_as(struct plnstr *pp)
        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;
@@ -384,8 +384,8 @@ launch_sat(struct plnstr *pp, int sublaunch)
     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);