From f819c378c1d9e6dd4a7788d004b65e4a69402e88 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 6 Mar 2016 06:25:57 -0500 Subject: fix mchenry formatting when repair price is >= 100 million --- messages.pl | 2 +- taipan.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/messages.pl b/messages.pl index 5c7638f..1b81767 100644 --- a/messages.pl +++ b/messages.pl @@ -171,7 +171,7 @@ but_no_debt "(But no debt!)" mchenry_has_arrived "Mc Henry from the Hong Kong\r\nShipyards has arrived!! He says, 'I see\r\nye've a wee bit of damage to yer ship.'\r\nWill ye be wanting repairs? " tis_a_pity "Och, 'tis a pity to be " percent_damaged "% damaged.\r\nWe can fix yer whole ship for " -or_partial_repairs ",\r\nor make partial repairs if you wish.\r\n" +or_partial_repairs "\r\nor make partial repairs if you wish.\r\n" will_ye_spend "will ye spend? " illionaire " I L L I O N A I R E !" youre_a " Y o u ' r e a" diff --git a/taipan.c b/taipan.c index a027750..30c5824 100644 --- a/taipan.c +++ b/taipan.c @@ -40,7 +40,7 @@ /* define this to test the mchenry() routine by entering damage and capacity numbers directly */ -// #define MCHENRY_TEST +#define MCHENRY_TEST /* define this to test the cprintfancy_big() routine */ // #define BIGNUM_TEST @@ -1829,6 +1829,9 @@ void mchenry(void) { amount; */ + /* the calculations below can & will overflow, but you'd have to + play a *long* time (like, year 2000 or later), and have a ship + capacity over maybe 10,000. */ br = ((randclamp(60 * (time + 3) / 4) + 25 * (time + 3) / 4) * capacity / 50); repair_price = (br * damage) + 1; @@ -1839,7 +1842,8 @@ void mchenry(void) { // cputs("% damaged.\nWe can fix yer whole ship for "); print_msg(M_percent_damaged); cprintulong(repair_price); - // cputs(",\nor make partial repairs if you wish.\n"); + gotoy(19); /* in case last digit printed at (39, 19) */ + // cputs("\nor make partial repairs if you wish.\n"); print_msg(M_or_partial_repairs); how_much(); // cputs("will ye spend? "); -- cgit v1.2.3