From: Markus Armbruster Date: Sun, 8 Feb 2015 11:38:55 +0000 (+0100) Subject: Revert "Permit ships that can drop depth charges, but not fire" X-Git-Tag: v4.3.33~46 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=ee3b02c514b1410fa60f317d26a73ae813d2005c Revert "Permit ships that can drop depth charges, but not fire" This reverts commit 9b0b0dc7729b7fadc09d5769cc1128341b3c3d33. The fire command drops depth charges when the target is a submarine in range and firing ship has the capability. Else, it blindly fires guns. It used to reject ships that can't use guns, even when they could use depth charges, but commit 9b0b0dc (v4.3.31) lifted that restruction. No such ships exist in the stock game. If the firing ship can't fire guns, shp_fire() returns -1, triggering an oops. Broken in commit 0757042. Avoiding dependence of depth charge on gun fire capability is pleasing, but nevertheless a bad idea without test coverage. Creating the necessary tests isn't worth it, so put back the traditional restriction instead. Signed-off-by: Markus Armbruster --- diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 527dba16b..e679074ef 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -170,8 +170,7 @@ multifire(void) pr("Not enough mil on ship #%d\n", item.ship.shp_uid); continue; } - if (mchr[item.ship.shp_type].m_glim == 0 - && !(mchr[fship.shp_type].m_flags & M_DCH)) { + if (mchr[item.ship.shp_type].m_glim == 0) { pr("Ships %d cannot fire guns!\n", item.ship.shp_uid); continue; }