From bd040918a1c6d175728e44cb5a456ce62e5500c5 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 20 Feb 2016 16:30:08 +0000 Subject: [PATCH] use helper functions instead of direct access to 0x00982164 --- src/windows/ride.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/windows/ride.c b/src/windows/ride.c index 29eb14b086..91d4f27b9a 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5798,9 +5798,7 @@ static void window_ride_income_paint(rct_window *w, rct_drawpixelinfo *dpi) profit = ride->price; stringId = STR_PROFIT_PER_ITEM_SOLD; - profit -= primaryItem < 32 ? - RCT2_GLOBAL(0x00982164 + (primaryItem * 8), uint16) : - RCT2_GLOBAL(0x00982144 + (primaryItem * 8), uint16); + profit -= get_shop_item_cost(primaryItem); if (profit < 0) { profit *= -1; stringId = STR_LOSS_PER_ITEM_SOLD; @@ -5819,9 +5817,7 @@ static void window_ride_income_paint(rct_window *w, rct_drawpixelinfo *dpi) profit = ride->price_secondary; stringId = STR_PROFIT_PER_ITEM_SOLD; - profit -= secondaryItem < 32 ? - RCT2_GLOBAL(0x00982164 + (secondaryItem * 8), uint16) : - RCT2_GLOBAL(0x00982144 + (secondaryItem * 8), uint16); + profit -= get_shop_item_cost(secondaryItem); if (profit < 0) { profit *= -1; stringId = STR_LOSS_PER_ITEM_SOLD;