]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/laun.c
commands: Rename the command functions
[empserver] / src / lib / commands / laun.c
index c805489a803ec9fd0bf2851a72d3c149314a8117..9e1466b5cb282d0f0d7db4de2d68e115f4af1b8d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -30,7 +30,7 @@
  *     Dave Pare, 1986
  *     Ken Stevens, 1995
  *     Steve McClure, 1998-2000
- *     Markus Armbruster, 2005-2015
+ *     Markus Armbruster, 2005-2021
  */
 
 #include <config.h>
@@ -56,7 +56,7 @@ static int msl_equip(struct plnstr *, char);
  * laun <PLANES>
  */
 int
-laun(void)
+c_launch(void)
 {
     struct nstr_item nstr;
     struct plnstr plane;
@@ -143,7 +143,7 @@ launch_as(struct plnstr *pp)
        || !pln_is_in_orbit(&plane)) {
        pr("No such satellite exists!\n");
        return RET_FAIL;
-       /* Can be abused to find satellite ids.  Tolerable. */
+       /* Can be abused to find satellite IDs.  Tolerable. */
     }
 
     if (mapdist(pp->pln_x, pp->pln_y, plane.pln_x, plane.pln_y)
@@ -151,7 +151,7 @@ launch_as(struct plnstr *pp)
        pr("Range too great!\n");
        return RET_FAIL;
     }
-    if (msl_equip(pp, 'i') < 0)
+    if (msl_equip(pp, 0) < 0)
        return RET_FAIL;
     if (msl_launch(pp, EF_PLANE, prplane(&plane),
                   plane.pln_x, plane.pln_y, plane.pln_own, NULL) < 0)
@@ -277,7 +277,7 @@ launch_missile(struct plnstr *pp)
        if (target_ship.shp_effic < SHIP_MINEFF)
            pr("%s sunk!\n", prship(&target_ship));
        if (dam && (target_ship.shp_rflags & RET_INJURED))
-           retreat_ship(&target_ship, target_ship.shp_own, 'i');
+           retreat_ship(&target_ship, target_ship.shp_own);
        putship(target_ship.shp_uid, &target_ship);
     }
     return RET_OK;
@@ -345,6 +345,7 @@ launch_sat(struct plnstr *pp)
     CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED);
     pp->pln_flags |= PLN_LAUNCHED;
     pp->pln_mobil = pp->pln_mobil > dist ? pp->pln_mobil - dist : 0;
+    pp->pln_ship = pp->pln_land = -1;
     putplane(pp->pln_uid, pp);
     pr("%s positioned over %s, will be ready for use in %d time units\n",
        prplane(pp), xyas(sx, sy, player->cnum),