Factor out torpedo hit chance into shp_torp_hitchance()

This commit is contained in:
Markus Armbruster 2008-03-03 20:59:39 +01:00
parent 4849600cd5
commit 504f035450
5 changed files with 24 additions and 17 deletions

View file

@ -34,7 +34,6 @@
#include <config.h>
#include "commands.h"
#include "damage.h"
#include "empobj.h"
#include "optlist.h"
#include "retreat.h"
@ -742,7 +741,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
fp->type = targ_ship;
fp->uid = ship.shp_uid;
add_to_fired_queue(&fp->queue, list);
if (!chance(DTORP_HITCHANCE(range, ship.shp_visib)))
if (!chance(shp_torp_hitchance(&ship, range)))
continue;
dam += dam2;
} else {