/* Mega-Hack -- Black market sucks */
if (cur_store_num == STORE_BLACK)
price = price / 2;
+
+ /* Compute the final price (with rounding) */
+ /* Hack -- prevent underflow */
+ price = (price * adjust + 50L) / 100L;
}
/* Shop is selling */
/* Mega-Hack -- Black market sucks */
if (cur_store_num == STORE_BLACK)
price = price * 2;
- }
- /* Compute the final price (with rounding) */
- /* Hack -- prevent overflow */
- price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
+ /* Compute the final price (with rounding) */
+ /* Hack -- prevent overflow */
+ price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
+ }
/* Note -- Never become "free" */
if (price <= 0L) return (1L);