diff --git a/src/lib/commands/torp.c b/src/lib/commands/torp.c index 951c8a37..f042f92b 100644 --- a/src/lib/commands/torp.c +++ b/src/lib/commands/torp.c @@ -161,7 +161,7 @@ torp(void) range = mapdist(sub.shp_x, sub.shp_y, vship.shp_x, vship.shp_y); hitchance = shp_torp_hitchance(&sub, range); if (range <= erange) { - pr("Hitchance = %d%%\n", (int)(hitchance * 100)); + pr("Hitchance = %.0f%%\n", hitchance * 100); } if (range > erange) pr("Out of range\n"); diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index e5288bcc..8ec2cd60 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -487,8 +487,7 @@ perform_mission_ship(int dam, struct shpstr *sp, coord x, coord y, wu(0, sp->shp_own, "\tEffective torpedo range is %d.0\n", range); wu(0, sp->shp_own, - "\tWhooosh... Hitchance = %d%%\n", - (int)(hitchance * 100)); + "\tWhooosh... Hitchance = %.0f%%\n", hitchance * 100); if (!chance(hitchance)) { wu(0, sp->shp_own, "\tMissed\n");