]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/mslsub.c
Update copyright notice
[empserver] / src / lib / subs / mslsub.c
index 8ab1694b9334067741652de10be7c3d54f808bb1..f5decdd09a177b2087a184687b335d3272c2e458 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 @@
  *  ---
  *
  *  mslsub.c: Missile subroutine stuff
- * 
+ *
  *  Known contributors to this file:
  *     Ken Stevens, 1995
  *     Steve McClure, 1996-2000
@@ -42,6 +42,7 @@
 #include "nat.h"
 #include "news.h"
 #include "nsc.h"
+#include "nuke.h"
 #include "optlist.h"
 #include "path.h"
 #include "plane.h"
@@ -129,8 +130,10 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
     putplane(pp->pln_uid, pp);
     mpr(pp->pln_own, "\tSHWOOOOOSH!  Missile launched!\n");
 
-    if (pp->pln_nuketype != -1)
+    if (nuk_on_plane(pp) >= 0) {
        mpr(pp->pln_own, "\tArming nuclear warheads...\n");
+       hitchance = 100;
+    }
 
     if (pcp->pl_flags & P_T)
        mpr(victim, "Incoming %s missile sighted at %s...\n",
@@ -150,9 +153,6 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
        }
     }
 
-    if (pp->pln_nuketype != -1)
-       hitchance = 100;
-
     mpr(pp->pln_own, "\t%d%% hitchance...", hitchance);
     hit = (roll(100) <= hitchance);