From 5e96da663407ca1e081483baa521d44811769be7 Mon Sep 17 00:00:00 2001 From: Patrick Wijnings Date: Sat, 30 Aug 2014 15:11:19 +0200 Subject: [PATCH 1/3] Fix definition of PARK_FLAGS_NO_MONEY flag and clean up related code. --- src/award.c | 4 ++-- src/finance.c | 33 ++++++++++++++++++++++++++++---- src/finance.h | 1 + src/game.c | 2 +- src/park.c | 4 ++-- src/park.h | 4 ++-- src/scenario.c | 4 ++-- src/window_game_bottom_toolbar.c | 6 +++--- src/window_park.c | 15 +++++++++++++-- src/window_staff.c | 2 +- 10 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/award.c b/src/award.c index 397af63a45..d338ca27c1 100644 --- a/src/award.c +++ b/src/award.c @@ -155,7 +155,7 @@ static int award_is_deserved_best_value(int awardType, int activeAwardTypes) return 0; if (activeAwardTypes & (1 << PARK_AWARD_MOST_DISAPPOINTING)) return 0; - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & (PARK_FLAGS_11 | PARK_FLAGS_PARK_FREE_ENTRY)) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & (PARK_FLAGS_NO_MONEY | PARK_FLAGS_PARK_FREE_ENTRY)) return 0; if (RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, money16) < MONEY(10, 00)) return 0; @@ -205,7 +205,7 @@ static int award_is_deserved_worse_value(int awardType, int activeAwardTypes) { if (activeAwardTypes & (1 << PARK_AWARD_BEST_VALUE)) return 0; - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) return 0; if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16) == MONEY(0, 00)) return 0; diff --git a/src/finance.c b/src/finance.c index 601af718f8..7c2e842b0c 100644 --- a/src/finance.c +++ b/src/finance.c @@ -74,7 +74,7 @@ void finance_pay_wages() rct_peep* peep; uint16 spriteIndex; - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) return; FOR_ALL_STAFF(spriteIndex, peep) @@ -89,7 +89,7 @@ void finance_pay_research() { uint8 level; - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) return; level = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8); @@ -106,7 +106,7 @@ void finance_pay_interest() sint16 current_interest = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, sint16); money32 tempcost = (current_loan * 5 * current_interest) >> 14; // (5 * interest) / 2^14 is pretty close to - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800) + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) return; finance_payment(tempcost, RCT_EXPENDITURE_TYPE_INTEREST); @@ -127,7 +127,7 @@ void finance_pay_ride_upkeep() ride->var_196 = 25855; // durability? } - if (ride->status != RIDE_STATUS_CLOSED && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) { + if (ride->status != RIDE_STATUS_CLOSED && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { sint16 upkeep = ride->upkeep_cost; if (upkeep != -1) { ride->var_158 -= upkeep; @@ -185,6 +185,31 @@ void finance_init() { sub_69E869(); } +/** +* +* rct2: 0x0069E79A +*/ +void finance_update_daily_profit() +{ + // 0x0135832C is related to savegames + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 7 * RCT2_GLOBAL(0x0135832C, money32); + RCT2_GLOBAL(0x0135832C, money32) = 0; + + int32 eax = 0; + + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) + { + + } + + eax /= 4; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) += eax; + RCT2_GLOBAL(0x1358334, money32) += eax; + RCT2_GLOBAL(0x1358338, money32) += 1; + + //invalidate_window(al = 1C, bx = 0) +} + void sub_69E869() { // This subroutine is loan related and is used for cheat detection diff --git a/src/finance.h b/src/finance.h index 02e0dc6aab..e839dd3914 100644 --- a/src/finance.h +++ b/src/finance.h @@ -41,6 +41,7 @@ void finance_pay_interest(); void finance_pay_ride_upkeep(); void finance_reset_history(); void finance_init(); +void finance_update_daily_profit(); void sub_69E869(); #endif \ No newline at end of file diff --git a/src/game.c b/src/game.c index 51923944ee..a7abc48603 100644 --- a/src/game.c +++ b/src/game.c @@ -1860,7 +1860,7 @@ void handle_shortcut_command(int shortcutIndex) break; case SHORTCUT_SHOW_FINANCIAL_INFORMATION: if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C)) - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) window_finances_open(); break; case SHORTCUT_SHOW_RESEARCH_INFORMATION: diff --git a/src/park.c b/src/park.c index ba0457c3fc..94b2371f69 100644 --- a/src/park.c +++ b/src/park.c @@ -103,7 +103,7 @@ void park_init() RCT2_GLOBAL(RCT2_ADDRESS_LAND_COST, uint16) = MONEY(90, 00); RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCTION_RIGHTS_COST, uint16) = MONEY(40,00); RCT2_GLOBAL(0x01358774, uint16) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = PARK_FLAGS_11 | PARK_FLAGS_SHOW_REAL_GUEST_NAMES; + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = PARK_FLAGS_NO_MONEY | PARK_FLAGS_SHOW_REAL_GUEST_NAMES; park_reset_history(); finance_reset_history(); award_reset(); @@ -427,7 +427,7 @@ static int park_calculate_guest_generation_probability() probability /= 4; // Check if money is enabled - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) { + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { // Penalty for overpriced entrance fee relative to total ride value money16 entranceFee = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16); if (entranceFee > totalRideValue) { diff --git a/src/park.h b/src/park.h index b12fcbad51..8f71122a88 100644 --- a/src/park.h +++ b/src/park.h @@ -35,11 +35,11 @@ enum { PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6), PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7), PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 8), - PARK_FLAGS_11 = (1 << 11), + PARK_FLAGS_NO_MONEY = (1 << 11), PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12), PARK_FLAGS_PARK_FREE_ENTRY = (1 << 13), PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14), - PARK_FLAGS_NO_MONEY = (1 << 17), + PARK_FLAGS_NO_MONEY_SCENARIO = (1 << 17), // equivalent to PARK_FLAGS_NO_MONEY, but used in scenario editor PARK_FLAGS_18 = (1 << 18) }; diff --git a/src/scenario.c b/src/scenario.c index 441d23f3e0..76c6b9aaeb 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -223,8 +223,8 @@ void scenario_load_and_play(const rct_scenario_basic *scenario) RCT2_GLOBAL(0x009DEB7C, sint16) = 0; RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) &= 0xFFFFF7FF; - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & 0x20000) - RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= 0x800; + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & PARK_FLAGS_NO_MONEY_SCENARIO) + RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= PARK_FLAGS_NO_MONEY; RCT2_CALLPROC_EBPSAFE(0x00684AC3); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); news_item_init_queue(); diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index dac63397f1..d724ff3f54 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -171,7 +171,7 @@ static void window_game_bottom_toolbar_mouseup() switch (widgetIndex) { case WIDX_LEFT_OUTSET: case WIDX_MONEY: - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) window_finances_open(); break; case WIDX_GUESTS: @@ -332,7 +332,7 @@ static void window_game_bottom_toolbar_invalidate() } // Hide money if there is no money - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800) { + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) { window_game_bottom_toolbar_widgets[WIDX_MONEY].type = WWT_EMPTY; window_game_bottom_toolbar_widgets[WIDX_GUESTS].top = 1; window_game_bottom_toolbar_widgets[WIDX_GUESTS].bottom = 17; @@ -426,7 +426,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r y = window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + w->y + 4; // Draw money - if (!(RCT2_GLOBAL(0x0013573E4, uint32) & 0x800)) { + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { RCT2_GLOBAL(0x013CE952, int) = DECRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32)); gfx_draw_string_centred( dpi, diff --git a/src/window_park.c b/src/window_park.c index 98caf43f0e..ac7b207403 100644 --- a/src/window_park.c +++ b/src/window_park.c @@ -580,6 +580,7 @@ static void window_park_anchor_border_widgets(rct_window *w); static void window_park_align_tabs(rct_window *w); static void window_park_set_pressed_tab(rct_window *w); static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w); +static void window_park_set_disabled_tabs(rct_window *w); /** * @@ -599,7 +600,7 @@ rct_window *window_park_open() w->list_information_type = -1; w->var_48C = -1; w->var_492 = 0; - RCT2_CALLPROC_X(0x00667F8B, 0, 0, 0, 0, (int)w, 0, 0); + window_park_set_disabled_tabs(w); w->colours[0] = 1; w->colours[1] = 19; w->colours[2] = 19; @@ -607,6 +608,16 @@ rct_window *window_park_open() return w; } +/** + * + * rct2: 0x00667F8B + */ +void window_park_set_disabled_tabs(rct_window *w) +{ + // Disable price tab if money is disabled + w->disabled_widgets = (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) ? (1 << WIDX_TAB_4) : 0; +} + #pragma region Entrance page /** @@ -2267,7 +2278,7 @@ static void window_park_set_page(rct_window *w, int page) w->var_020 = RCT2_GLOBAL(0x0097BAE0 + (page * 4), uint32); w->event_handlers = window_park_page_events[page]; w->widgets = window_park_page_widgets[page]; - RCT2_CALLPROC_X(0x00667F8B, 0, 0, 0, 0, (int)w, 0, 0); + window_park_set_disabled_tabs(w); window_invalidate(w); RCT2_CALLPROC_X(w->event_handlers[WE_RESIZE], 0, 0, 0, 0, (int)w, 0, 0); diff --git a/src/window_staff.c b/src/window_staff.c index d23545d8f9..7d852e638b 100644 --- a/src/window_staff.c +++ b/src/window_staff.c @@ -663,7 +663,7 @@ void window_staff_paint() { rct2_free(sprite_dpi); } - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) { + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { RCT2_GLOBAL(0x013CE952, uint32) = RCT2_ADDRESS(0x00992A00, uint16)[selectedTab]; gfx_draw_string_left(dpi, 1858, (void*)0x013CE952, 0, w->x + 0xA5, w->y + 0x20); } From b832a7235b00d57cb7e781ce6af096e48aa6fd64 Mon Sep 17 00:00:00 2001 From: Patrick Wijnings Date: Sun, 31 Aug 2014 13:01:50 +0200 Subject: [PATCH 2/3] More PARK_FLAGS_NO_MONEY updates. Implement finance_update_daily_profit(). --- src/addresses.h | 1 + src/finance.c | 50 ++++++++++++++++++++++++++++++++----------- src/park.h | 2 ++ src/scenario.c | 10 ++++----- src/scenario.h | 4 ++-- src/window_new_ride.c | 4 ++-- src/window_peep.c | 2 +- 7 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/addresses.h b/src/addresses.h index d46574cc45..7bef46848b 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -236,6 +236,7 @@ #define RCT2_ADDRESS_OBJECTIVE_CURRENCY 0x013580FC #define RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS 0x01358100 #define RCT2_ADDRESS_BALANCE_HISTORY 0x0135812C +#define RCT2_ADDRESS_CURRENT_EXPENDITURE 0x0135832C #define RCT2_ADDRESS_CURRENT_PROFIT 0x01358330 #define RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY 0x0135833C #define RCT2_ADDRESS_CURRENT_PARK_VALUE 0x0135853C diff --git a/src/finance.c b/src/finance.c index ffb4496cca..785628ae74 100644 --- a/src/finance.c +++ b/src/finance.c @@ -57,7 +57,7 @@ void finance_payment(money32 amount, rct_expenditure_type type) RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(new_money); RCT2_ADDRESS(RCT2_ADDRESS_EXPENDITURE_TABLE, money32)[type] -= amount; if (RCT2_ADDRESS(0x00988E60, uint32)[type] & 1) - RCT2_GLOBAL(0x0135832C, money32) -= amount; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32) -= amount; // Cumulative amount of money spent this day RCT2_GLOBAL(0x009A9804, uint32) |= 1; // money diry flag @@ -158,11 +158,10 @@ void finance_init() { RCT2_ADDRESS(RCT2_ADDRESS_EXPENDITURE_TABLE, money32)[i] = 0; } - RCT2_GLOBAL(0x0135832C, uint32) = 0; - + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, uint32) = 0; RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 0; - RCT2_GLOBAL(0x01358334, uint32) = 0; + RCT2_GLOBAL(0x01358334, money32) = 0; RCT2_GLOBAL(0x01358338, uint16) = 0; RCT2_GLOBAL(0x013573DC, money32) = MONEY(10000,00); // Cheat detection @@ -191,23 +190,48 @@ void finance_init() { */ void finance_update_daily_profit() { - // 0x0135832C is related to savegames - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 7 * RCT2_GLOBAL(0x0135832C, money32); - RCT2_GLOBAL(0x0135832C, money32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 7 * RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32); + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32) = 0; // Reset daily expenditure - int32 eax = 0; + money32 current_profit = 0; if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { + // Staff costs + uint16 sprite_index; + rct_peep *peep; + FOR_ALL_STAFF(sprite_index, peep) { + uint8 staff_type = peep->staff_type; + current_profit -= wage_table[peep->staff_type]; + } + + // Research costs + uint8 level = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8); + current_profit -= research_cost_table[level]; + + // Loan costs + money32 current_loan = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32); + current_profit -= current_loan / 600; + + // Ride costs + rct_ride *ride; + int i; + FOR_ALL_RIDES(i, ride) { + if (ride->status != RIDE_STATUS_CLOSED && ride->upkeep_cost != -1) { + current_profit -= 2 * ride->upkeep_cost; + } + } } - eax /= 4; - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) += eax; - RCT2_GLOBAL(0x1358334, money32) += eax; - RCT2_GLOBAL(0x1358338, money32) += 1; + // This is not equivalent to / 4 due to rounding of negative numbers + current_profit = current_profit >> 2; - //invalidate_window(al = 1C, bx = 0) + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) += current_profit; + RCT2_GLOBAL(0x1358334, money32) += RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32); + RCT2_GLOBAL(0x1358338, uint16) += 1; + + window_invalidate_by_id(WC_FINANCES, 0); } void sub_69E869() diff --git a/src/park.h b/src/park.h index 8f71122a88..8a27dfdc8d 100644 --- a/src/park.h +++ b/src/park.h @@ -59,4 +59,6 @@ void park_update_histories(); uint8 calculate_guest_initial_happiness(uint8 percentage); +void game_command_set_park_entrance_fee(); + #endif diff --git a/src/scenario.c b/src/scenario.c index e88c4dfa09..9154ce9e81 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -142,7 +142,7 @@ void scenario_load(const char *path) sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES); // Read ? - sawyercoding_read_chunk(file, (uint8*)0x0135832C); + sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_EXPENDITURE); // Read ? sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_PARK_VALUE); @@ -279,9 +279,9 @@ void scenario_load_and_play(const rct_scenario_basic *scenario) strcat((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, ".SV6"); memset((void*)0x001357848, 0, 56); - RCT2_GLOBAL(0x0135832C, uint32) = 0; - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, sint32) = 0; - RCT2_GLOBAL(0x01358334, uint32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, uint32) = 0; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 0; + RCT2_GLOBAL(0x01358334, money32) = 0; RCT2_GLOBAL(0x01358338, uint16) = 0; RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, uint32) = 0x80000000; RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0; @@ -577,7 +577,7 @@ void scenario_update() if ((current_days_in_month * next_month_tick) >> 16 != (current_days_in_month * month_tick) >> 16) { // daily checks - RCT2_CALLPROC_EBPSAFE(0x0069E79A); // daily profit update + finance_update_daily_profit(); // daily profit update RCT2_CALLPROC_EBPSAFE(0x0069C35E); // some kind of peeps days_visited update loop get_local_time(); RCT2_CALLPROC_EBPSAFE(0x0066A13C); // objective 6 dragging diff --git a/src/scenario.h b/src/scenario.h index 4ab1e2d2b2..cbd5b5d764 100644 --- a/src/scenario.h +++ b/src/scenario.h @@ -204,8 +204,8 @@ typedef struct { money32 balance_history[128]; // SC6[11] - uint32 dword_0135832C; - uint32 current_profit; + money32 current_expenditure; + money32 current_profit; uint32 dword_01358334; uint16 word_01358338; uint8 pad_0135833A[2]; diff --git a/src/window_new_ride.c b/src/window_new_ride.c index f744a63c24..9b061810f0 100644 --- a/src/window_new_ride.c +++ b/src/window_new_ride.c @@ -468,7 +468,7 @@ static void window_new_ride_refresh_widget_sizing(rct_window *w) window_new_ride_widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WWT_GROUPBOX; window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WWT_GROUPBOX; window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN; - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) window_new_ride_widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WWT_FLATBTN; width = 300; @@ -944,7 +944,7 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli } // Price - if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) { + if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) { // Get price of ride int unk2 = RCT2_GLOBAL(0x0097CC68 + (item.type * 2), uint8); money32 price = RCT2_GLOBAL(0x0097DD78 + (item.type * 4), uint16); diff --git a/src/window_peep.c b/src/window_peep.c index 8d154f4e74..a85331101c 100644 --- a/src/window_peep.c +++ b/src/window_peep.c @@ -500,7 +500,7 @@ void window_peep_disable_widgets(rct_window* w){ if (!(w->disabled_widgets & (1 << WIDX_PICKUP))) window_invalidate(w); } - if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11){ + if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){ disabled_widgets |= (1 << WIDX_TAB_4); //Disable finance tab if no money } w->disabled_widgets = disabled_widgets; From 9a6537209db2f3bd838d4f0d98f07d5da9acc3e0 Mon Sep 17 00:00:00 2001 From: Patrick Wijnings Date: Sun, 31 Aug 2014 13:06:24 +0200 Subject: [PATCH 3/3] Add comment to finance_update_daily_profit(). --- src/finance.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/finance.c b/src/finance.c index 785628ae74..efedfdff63 100644 --- a/src/finance.c +++ b/src/finance.c @@ -228,6 +228,8 @@ void finance_update_daily_profit() current_profit = current_profit >> 2; RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) += current_profit; + + // These are related to weekly profit graph RCT2_GLOBAL(0x1358334, money32) += RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32); RCT2_GLOBAL(0x1358338, uint16) += 1;