aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-03-06 06:25:57 -0500
committerB. Watson <yalhcru@gmail.com>2016-03-06 06:25:57 -0500
commitf819c378c1d9e6dd4a7788d004b65e4a69402e88 (patch)
tree64616592dba790b0f530ab0dd0a9479f2754f40c
parenta530a134ef024a3bf53d0c79c03adca095e00168 (diff)
downloadtaipan-f819c378c1d9e6dd4a7788d004b65e4a69402e88.tar.gz
fix mchenry formatting when repair price is >= 100 million
-rw-r--r--messages.pl2
-rw-r--r--taipan.c8
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? ");