aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--taipan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/taipan.c b/taipan.c
index 7ef42f0..8ee33c8 100644
--- a/taipan.c
+++ b/taipan.c
@@ -401,10 +401,13 @@ unsigned long cash = 0,
unsigned long price[4];
-const int base_price[4][8] = { {1000, 11, 16, 15, 14, 12, 10, 13},
- {100, 11, 14, 15, 16, 10, 13, 12},
- {10, 12, 16, 10, 11, 13, 14, 15},
- {1, 10, 11, 12, 13, 14, 15, 16} };
+const int base_price[4][8] = {
+ /* each row: first number is base price, the rest are
+ multiplier at each port (1-7) */
+ {1000, 11, 16, 15, 14, 12, 10, 13}, /* opium */
+ {100, 11, 14, 15, 16, 10, 13, 12}, /* silk */
+ {10, 12, 16, 10, 11, 13, 14, 15}, /* arms */
+ {1, 10, 11, 12, 13, 14, 15, 16} }; /* general */
/* hkw_ is the warehouse, hold_ is how much of each item is
in your hold. both need to be unsigned (makes no sense to
@@ -1637,7 +1640,7 @@ void cash_or_guns(void) {
void set_prices(void) {
char i;
for(i = 0; i < 4; ++i)
- price[i] = base_price[i][port] / 2 * rand1to3() * base_price[i][0];
+ price[i] = (base_price[i][port] * rand1to3() * base_price[i][0]) / 2;
}
unsigned int warehouse_in_use() {