Remove redundant load checks before pln_damage()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 3 Oct 2009 20:32:03 +0000 (16:32 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Dec 2009 15:28:52 +0000 (16:28 +0100)
pln_damage() copes with any load just fine.

src/lib/commands/bomb.c

index c5021232c7ecb7697e85daa68bb0b5ba499f919e..850f0f1371cb4b89a81e37cca02ae3a15709e596 100644 (file)
@@ -344,9 +344,8 @@ eff_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if (plp->load || nuk_on_plane(&plp->plane) >= 0)
-           dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
-                             'p', &nukedam, 1);
+       dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
+                         'p', &nukedam, 1);
     }
     if (dam <= 0)              /* dam == 0 if only nukes were delivered */
        return;
@@ -422,9 +421,8 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if (plp->load || nuk_on_plane(&plp->plane) >= 0)
-           dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
-                             'p', &nukedam, 1);
+       dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
+                         'p', &nukedam, 1);
     }
     if (dam <= 0)              /* dam == 0 if only nukes were delivered */
        return;
@@ -796,9 +794,8 @@ strat_bomb(struct emp_qelem *list, struct sctstr *target)
 
     for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
        plp = (struct plist *)qp;
-       if (plp->load || nuk_on_plane(&plp->plane) >= 0)
-           dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
-                             's', &nukedam, 1);
+       dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
+                         's', &nukedam, 1);
     }
     if (dam <= 0)              /* dam == 0 if only nukes were delivered */
        return;