]> 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 bb5400e7732a1979abb8e8ceebdb078e9b4c9e40..1e78e443c368d7423916a19fbf1521df1bd86c44 100644 (file)
@@ -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);