]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/aircombat.c
Clean up dead stores
[empserver] / src / lib / subs / aircombat.c
index d5dbbc852dd784ffb33077bbe5e78ebd0606a175..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
@@ -295,7 +295,7 @@ sam_intercept(struct emp_qelem *att_list, struct emp_qelem *def_list,
                && pp->pln_radius < mapdist(x, y, pp->pln_opx, pp->pln_opy))
                continue;
            if (CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED)
-               || mission_pln_equip(dplp, 0, P_F, 0) < 0) {
+               || mission_pln_equip(dplp, NULL, 0) < 0) {
                emp_remque(dqp);
                free(dqp);
                continue;
@@ -369,7 +369,7 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
            && pp->pln_radius < mapdist(x, y, pp->pln_opx, pp->pln_opy))
            continue;
        if (CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED)
-           || mission_pln_equip(plp, 0, P_F, 0) < 0) {
+           || mission_pln_equip(plp, NULL, 0) < 0) {
            emp_remque(qp);
            free(qp);
            continue;
@@ -378,7 +378,7 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
        emp_remque(qp);
        emp_insque(qp, &int_list);
        pp->pln_flags |= PLN_LAUNCHED;
-       pp->pln_mobil -= pln_mobcost(dist, pp, P_F);
+       pp->pln_mobil -= pln_mobcost(dist, pp, 0);
        putplane(pp->pln_uid, pp);
        icount++;
        if (icount > att_count)
@@ -399,7 +399,7 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
     pln_put(&int_list);
 }
 
-void
+static void
 ac_combat_headers(natid plane_owner, natid def_own)
 {
     PR(plane_owner,
@@ -413,14 +413,13 @@ ac_combat_headers(natid plane_owner, natid def_own)
 /*
  * air-to-air combat.
  */
-void
+static void
 ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
 {
     struct plist *attacker;
     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 != 0)
+    if ((ap->pcp->pl_flags & P_F) && ap->load != 0)
        att -= 2;
-    if ((dp->pcp->pl_flags & P_F) && dp->bombs != 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]);