1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Create define for MONEY16_UNDEFINED

This commit is contained in:
Michael Steenbeek
2017-10-17 17:12:49 +02:00
parent 79365b7a91
commit ac7652f61d
5 changed files with 5 additions and 4 deletions

View File

@@ -280,7 +280,7 @@ public:
ride->music_tune_id = 255;
ride->breakdown_reason = 255;
ride->upkeep_cost = (money16)-1;
ride->upkeep_cost = MONEY16_UNDEFINED;
ride->reliability = RIDE_INITIAL_RELIABILITY;
ride->unreliability_factor = 1;
ride->inspection_interval = RIDE_INSPECTION_EVERY_30_MINUTES;

View File

@@ -182,6 +182,7 @@ typedef fixed64_1dp money64;
#define MONEY(whole, fraction) ((whole) * 10 + ((fraction) / 10))
#define MONEY_FREE MONEY(0,00)
#define MONEY16_UNDEFINED (money16)(uint16)0xFFFF
#define MONEY32_UNDEFINED ((money32)0x80000000)
typedef void (EMPTY_ARGS_VOID_POINTER)();

View File

@@ -268,7 +268,7 @@ void finance_update_daily_profit()
sint32 i;
FOR_ALL_RIDES(i, ride)
{
if (ride->status != RIDE_STATUS_CLOSED && ride->upkeep_cost != -1)
if (ride->status != RIDE_STATUS_CLOSED && ride->upkeep_cost != MONEY16_UNDEFINED)
{
current_profit -= 2 * ride->upkeep_cost;
}

View File

@@ -2020,7 +2020,7 @@ static void ride_update(sint32 rideIndex)
ride->income_per_hour = ride_calculate_income_per_hour(ride);
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
if (ride->upkeep_cost != (money16)(uint16)0xFFFF)
if (ride->upkeep_cost != MONEY16_UNDEFINED)
ride->profit = (ride->income_per_hour - ((money32)ride->upkeep_cost * 16));
}

View File

@@ -6209,7 +6209,7 @@ static void window_ride_income_paint(rct_window *w, rct_drawpixelinfo *dpi)
// Running cost per hour
costPerHour = ride->upkeep_cost * 16;
stringId = ride->upkeep_cost == (money16)(uint16)0xFFFF ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR;
stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR;
gfx_draw_string_left(dpi, stringId, &costPerHour, COLOUR_BLACK, x, y);
y += 10;