]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/mslsub.c
Nuclear-tipped missile exploding on launch could not damage base
[empserver] / src / lib / subs / mslsub.c
index 1edb5f9dcc69e26e3890a227ad2561a4bf5b92ea..1e78e443c368d7423916a19fbf1521df1bd86c44 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -59,6 +59,7 @@ msl_launch(struct plnstr *pp, int type, char *what, coord x, coord y,
           natid victim, int *sublaunchp)
 {
     struct shpstr ship;
+    struct nukstr nuke;
     struct sctstr sect;
     int sublaunch = 0;
     char *from;
@@ -93,6 +94,11 @@ msl_launch(struct plnstr *pp, int type, char *what, coord x, coord y,
     if (chance((0.05 + (100 - pp->pln_effic) / 100.0)
               * (1 - techfact(pp->pln_tech, 1.0)))) {
        mpr(pp->pln_own, "KABOOOOM!  Missile explodes %s!\n", from);
+       if (getnuke(nuk_on_plane(pp), &nuke)) {
+           pr("%s lost!\n", prnuke(&nuke));
+           nuke.nuk_effic = 0;
+           putnuke(nuke.nuk_uid, &nuke);
+       }
        if (chance(0.33)) {
            dam = pln_damage(pp, 'p', 1) / 2;
            if (pp->pln_ship >= 0) {
@@ -216,7 +222,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
              int news_item)
 {
     struct plnstr *pp;
-    struct plchrstr *pcp;
     struct emp_qelem *intlist;
     struct emp_qelem intfoo;
     struct emp_qelem *qp;
@@ -236,7 +241,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
        pp = &ip->plane;
        if (pp->pln_own != sp->sct_own)
            continue;
-       pcp = ip->pcp;
        if (mission_pln_equip(ip, NULL, 'i') < 0) {
            emp_remque(qp);
            free(qp);
@@ -255,7 +259,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
        next = qp->q_forw;
        ip = (struct plist *)qp;
        pp = &ip->plane;
-       pcp = ip->pcp;
        if (mission_pln_equip(ip, NULL, 'i') < 0) {
            emp_remque(qp);
            free(qp);
@@ -287,7 +290,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
        qp = intlist->q_forw;
        ip = (struct plist *)qp;
        pp = &ip->plane;
-       pcp = ip->pcp;
 
        mpr(msl->pln_own, "%s %s launched in defense!\n",
            cname(pp->pln_own), def_name);