Factor out common torpedo fire code into shp_torp()
This takes care of a number of bugs / inconsistencies: * Submarines with zero mobility could interdict. Change to require positive mobility. * Submarines with zero firing range could not interdict. Fix by dropping the test from perform_mission(). No ships in the stock game are affected. * Submarines without capability torp could fire return torpedoes and interdict. Stock sbc, nm and msb were affected by the return fire bug. Closes bug#950936. * Shell resupply bugs: quiet_bigdef(), fire_torp() and perform_mission() resupplied before checking all other requirements and could thus get more shells than actually needed. torp() no longer resupplies shells. It's hardly worth the bother, and fire doesn't do it either.
This commit is contained in:
parent
21733d1473
commit
6d83090aad
5 changed files with 60 additions and 105 deletions
|
@ -185,5 +185,6 @@ extern int m_glim(struct mchrstr *, int);
|
|||
|
||||
extern int shp_dchrg(struct shpstr *);
|
||||
extern int shp_fire(struct shpstr *);
|
||||
extern int shp_torp(struct shpstr *, int);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue