]> git.pond.sub.org Git - empserver/commitdiff
Fix bomb for non-tactical cargo bomber
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 3 Oct 2009 19:57:49 +0000 (15:57 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Dec 2009 15:28:52 +0000 (16:28 +0100)
The various bombing functions silently skipped planes not carrying
bombs.  This sanity check was wrong: it checked capabilities "tactical
or not cargo" instead of "tactical or bomber", and failed for
non-tactical cargo bombers.  No such planes exist in the stock game.
The broken check comes from Chainsaw; it replaced an equally wrong
"not cargo" check.

Because pln_sel() lets only suitable planes go on a bombing run, the
broken sanity check is unnecessary.  Drop it.

src/lib/commands/bomb.c

index 2a8bbeb26fd9f1c6bff535997c6973b8d30496ab..f3a2c44f476e9e02a66b14e12cc328928d31f84a 100644 (file)
@@ -344,8 +344,6 @@ eff_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        if (plp->bombs || nuk_on_plane(&plp->plane) >= 0)
            dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
                              'p', &nukedam, 1);
@@ -424,8 +422,6 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        if (plp->bombs || nuk_on_plane(&plp->plane) >= 0)
            dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
                              'p', &nukedam, 1);
@@ -478,8 +474,6 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        if (plp->pcp->pl_flags & P_A)
            nships = asw_shipsatxy(target->sct_x, target->sct_y, 0, 0,
                                   &plp->plane, &head);
@@ -605,8 +599,6 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        nplanes = planesatxy(target->sct_x, target->sct_y, 0, 0);
        if (nplanes == 0) {
            pr("%s could not find any planes!\n", prplane(&plp->plane));
@@ -711,8 +703,6 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
        if (nunits == 0) {
            pr("%s could not find any units!\n", prplane(&plp->plane));
@@ -806,8 +796,6 @@ 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->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
-           continue;
        if (plp->bombs || nuk_on_plane(&plp->plane) >= 0)
            dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
                              's', &nukedam, 1);