]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/aircombat.c
Clean up dead stores
[empserver] / src / lib / subs / aircombat.c
index 434546842a7d9f327f715321ae9f88802c2841cc..d23265fb9e852c0e9d61fb06726e2ee3bbc97102 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
@@ -420,7 +420,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
     struct plist *interceptor;
     struct emp_qelem *att;
     struct emp_qelem *in;
-    int nplanes;
     int more_att;
     int more_int;
     struct emp_qelem *att_next;
@@ -439,9 +438,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
        att_next = att->q_forw;
        attacker = (struct plist *)att;
        interceptor = (struct plist *)in;
-       nplanes = attacker->plane.pln_effic;
-       if (nplanes > interceptor->plane.pln_effic)
-           nplanes = interceptor->plane.pln_effic;
        ac_dog(attacker, interceptor);
        in = in_next;
        att = att_next;
@@ -492,9 +488,9 @@ ac_dog(struct plist *ap, struct plist *dp)
     def = pln_def(&dp->plane) * dp->plane.pln_effic / 100;
     def = MAX(def, dp->pcp->pl_def / 2);
 
-    if ((ap->pcp->pl_flags & P_F) && ap->bombs + ap->misc != 0)
+    if ((ap->pcp->pl_flags & P_F) && ap->load != 0)
        att -= 2;
-    if ((dp->pcp->pl_flags & P_F) && dp->bombs + ap->misc != 0)
+    if ((dp->pcp->pl_flags & P_F) && dp->load != 0)
        def -= 2;
     att += ap->pcp->pl_stealth / 25.0;
     def += dp->pcp->pl_stealth / 25.0;
@@ -751,8 +747,6 @@ ac_fireflak(struct emp_qelem *list, natid from, int guns)
     struct emp_qelem *next;
     char msg[255];
 
-    plp = (struct plist *)list->q_forw;
-
     for (qp = list->q_forw; qp != list; qp = next) {
        next = qp->q_forw;
        plp = (struct plist *)qp;
@@ -780,10 +774,6 @@ ac_flak_dam(int guns, int def, int pl_flags)
     flak = guns - def;
     if ((pl_flags & P_T) == 0)
        flak--;
-    if (pl_flags & P_X)
-       flak -= 2;
-    if (pl_flags & P_H)
-       flak -= 1;
 
     if (flak > 8)
        mult = flaktable[FLAK_MAX];
@@ -837,8 +827,7 @@ getilists(struct emp_qelem *list, unsigned char *rel, natid intruder)
            continue;
        /* got one! */
        ip = malloc(sizeof(*ip));
-       ip->bombs = 0;
-       ip->misc = 0;
+       ip->load = 0;
        ip->pcp = &plchr[(int)plane.pln_type];
        ip->plane = plane;
        emp_insque(&ip->queue, &list[plane.pln_own]);