diff options
-rw-r--r-- | taipan.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1310,9 +1310,13 @@ char sea_battle(char id, int num_ships) { time = get_time(); s0 = num_ships; - booty = (time / 4 * 1000 * num_ships) + randi()%1000 + 250; - if(would_overflow(cash, booty)) { - booty = 0L; + /* This calculation was different in the Apple and Linux ports. I went + with the Apple version. */ + booty = randclamp((long)(time / 4L * 1000L * num_ships)) + (long)(randi()%1000 + 250); + + /* Not ideal, but better than 'booty = 0L' I think. */ + while(would_overflow(cash, booty)) { + booty >>= 1; } clear_ships_on_screen(); |