]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/miss.c
mission: Fix an error message pasto going back to Chainsaw 3
[empserver] / src / lib / commands / miss.c
index a847578afa481d1f371424c301bfb192eaff3955..c050664785aa2d106f7c678bea91d84bd589ead8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2013, 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
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Thomas Ruschak, 1992
  *     Steve McClure, 2000
- *     Markus Armbruster, 2005-2010
+ *     Markus Armbruster, 2005-2021
  */
 
 #include <config.h>
@@ -165,7 +165,7 @@ mission(void)
        radius = 9999;
 
     while (nxtitem(&ni, &item)) {
-       gp = (struct empobj *)&item;
+       gp = &item.gen;
 
        if (!player->owner || gp->own == 0)
            continue;
@@ -211,7 +211,7 @@ mission(void)
 
            pcp = &plchr[(int)gp->type];
            if (!(pcp->pl_flags & P_F)) {
-               pr("Only planes with the intercept abilities can perform air defense.\n"
+               pr("Only planes with the intercept ability can perform air defense.\n"
                   "%s #%d is ineligible\n",
                   pcp->pl_name, gp->uid);
                continue;
@@ -222,6 +222,12 @@ mission(void)
            struct plchrstr *pcp;
 
            pcp = &plchr[(int)gp->type];
+           if (pcp->pl_flags & P_M) {
+               pr("Missiles can't escort.\n"
+                  "%s #%d is ineligible\n",
+                  pcp->pl_name, gp->uid);
+               continue;
+           }
            if (!(pcp->pl_flags & P_ESC) && !(pcp->pl_flags & P_F)) {
                pr("Only planes with the escort or intercept abilities can escort.\n"
                   "%s #%d is ineligible\n",
@@ -244,7 +250,8 @@ mission(void)
        }
 
        if (type == EF_PLANE && nuk_on_plane((struct plnstr *)gp) >= 0) {
-           pr("%s can't perform a mission while it carries a nuclear weapon",
+           pr("%s can't perform a mission"
+              " while it is carrying a nuclear weapon\n",
               unit_nameof(gp));
            continue;
        }
@@ -300,7 +307,7 @@ show_mission(struct nstr_item *np)
     struct empobj *gp;
 
     while (nxtitem(np, &item)) {
-       gp = (struct empobj *)&item;
+       gp = &item.gen;
        if (!player->owner || gp->own == 0)
            continue;