mirror of https://github.com/OpenRCT2/OpenRCT2.git
Integrate unknown game variables
This commit is contained in:
parent
f303642ceb
commit
708efdd08c
11
src/game.c
11
src/game.c
|
@ -67,6 +67,9 @@ bool gInUpdateCode = false;
|
||||||
int gGameCommandNestLevel;
|
int gGameCommandNestLevel;
|
||||||
bool gGameCommandIsNetworked;
|
bool gGameCommandIsNetworked;
|
||||||
|
|
||||||
|
uint8 gUnk13CA740;
|
||||||
|
uint8 gUnk141F568;
|
||||||
|
|
||||||
#ifdef NO_RCT2
|
#ifdef NO_RCT2
|
||||||
uint32 gCurrentTicks;
|
uint32 gCurrentTicks;
|
||||||
#endif
|
#endif
|
||||||
|
@ -342,7 +345,7 @@ void game_update()
|
||||||
window_map_tooltip_update_visibility();
|
window_map_tooltip_update_visibility();
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
RCT2_GLOBAL(0x0141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8);
|
gUnk141F568 = gUnk13CA740;
|
||||||
game_handle_input();
|
game_handle_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,7 +417,7 @@ void game_logic_update()
|
||||||
static int game_check_affordability(int cost)
|
static int game_check_affordability(int cost)
|
||||||
{
|
{
|
||||||
if (cost <= 0)return cost;
|
if (cost <= 0)return cost;
|
||||||
if (RCT2_GLOBAL(0x141F568, uint8) & 0xF0)return cost;
|
if (gUnk141F568 & 0xF0) return cost;
|
||||||
if (cost <= (sint32)(DECRYPT_MONEY(gCashEncrypted)))return cost;
|
if (cost <= (sint32)(DECRYPT_MONEY(gCashEncrypted)))return cost;
|
||||||
|
|
||||||
set_format_arg(0, uint32, cost);
|
set_format_arg(0, uint32, cost);
|
||||||
|
@ -545,7 +548,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
||||||
if (!(flags & 0x20)) {
|
if (!(flags & 0x20)) {
|
||||||
// Update money balance
|
// Update money balance
|
||||||
finance_payment(cost, gCommandExpenditureType);
|
finance_payment(cost, gCommandExpenditureType);
|
||||||
if (RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8)) {
|
if (gUnk141F568 == gUnk13CA740) {
|
||||||
// Create a +/- money text effect
|
// Create a +/- money text effect
|
||||||
if (cost != 0)
|
if (cost != 0)
|
||||||
money_effect_create(cost);
|
money_effect_create(cost);
|
||||||
|
@ -570,7 +573,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
||||||
game_command_callback = 0;
|
game_command_callback = 0;
|
||||||
|
|
||||||
// Show error window
|
// Show error window
|
||||||
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
|
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && gUnk141F568 == gUnk13CA740 && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
|
||||||
window_error_open(gGameCommandErrorTitle, gGameCommandErrorText);
|
window_error_open(gGameCommandErrorTitle, gGameCommandErrorText);
|
||||||
|
|
||||||
gGameCommandErrorText = STR_NONE;
|
gGameCommandErrorText = STR_NONE;
|
||||||
|
|
|
@ -145,6 +145,9 @@ extern bool gInUpdateCode;
|
||||||
extern int gGameCommandNestLevel;
|
extern int gGameCommandNestLevel;
|
||||||
extern bool gGameCommandIsNetworked;
|
extern bool gGameCommandIsNetworked;
|
||||||
|
|
||||||
|
extern uint8 gUnk13CA740;
|
||||||
|
extern uint8 gUnk141F568;
|
||||||
|
|
||||||
void game_increase_game_speed();
|
void game_increase_game_speed();
|
||||||
void game_reduce_game_speed();
|
void game_reduce_game_speed();
|
||||||
|
|
||||||
|
|
|
@ -9664,7 +9664,7 @@ static void peep_spend_money(rct_peep *peep, money16 *peep_expend_type, money32
|
||||||
}
|
}
|
||||||
window_invalidate_by_number(WC_PEEP, peep->sprite_index);
|
window_invalidate_by_number(WC_PEEP, peep->sprite_index);
|
||||||
|
|
||||||
RCT2_GLOBAL(0x00141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8);
|
gUnk141F568 = gUnk13CA740;
|
||||||
finance_payment(-amount, gCommandExpenditureType);
|
finance_payment(-amount, gCommandExpenditureType);
|
||||||
|
|
||||||
audio_play_sound_at_location(SOUND_PURCHASE, peep->x, peep->y, peep->z);
|
audio_play_sound_at_location(SOUND_PURCHASE, peep->x, peep->y, peep->z);
|
||||||
|
|
|
@ -405,7 +405,7 @@ void S6Exporter::Export()
|
||||||
memcpy(_s6.staff_modes, gStaffModes, sizeof(_s6.staff_modes));
|
memcpy(_s6.staff_modes, gStaffModes, sizeof(_s6.staff_modes));
|
||||||
// unk_13CA73E
|
// unk_13CA73E
|
||||||
// pad_13CA73F
|
// pad_13CA73F
|
||||||
_s6.byte_13CA740 = RCT2_GLOBAL(0x013CA740, uint8);
|
_s6.byte_13CA740 = gUnk13CA740;
|
||||||
_s6.climate = gClimate;
|
_s6.climate = gClimate;
|
||||||
// pad_13CA741;
|
// pad_13CA741;
|
||||||
memcpy(_s6.byte_13CA742, RCT2_ADDRESS(0x013CA742, uint8), sizeof(_s6.byte_13CA742));
|
memcpy(_s6.byte_13CA742, RCT2_ADDRESS(0x013CA742, uint8), sizeof(_s6.byte_13CA742));
|
||||||
|
|
|
@ -323,7 +323,7 @@ void S6Importer::Import()
|
||||||
memcpy(gStaffModes, _s6.staff_modes, sizeof(_s6.staff_modes));
|
memcpy(gStaffModes, _s6.staff_modes, sizeof(_s6.staff_modes));
|
||||||
// unk_13CA73E
|
// unk_13CA73E
|
||||||
// pad_13CA73F
|
// pad_13CA73F
|
||||||
RCT2_GLOBAL(0x013CA740, uint8) = _s6.byte_13CA740;
|
gUnk13CA740 = _s6.byte_13CA740;
|
||||||
gClimate = _s6.climate;
|
gClimate = _s6.climate;
|
||||||
// pad_13CA741;
|
// pad_13CA741;
|
||||||
memcpy(RCT2_ADDRESS(0x013CA742, uint8), _s6.byte_13CA742, sizeof(_s6.byte_13CA742));
|
memcpy(RCT2_ADDRESS(0x013CA742, uint8), _s6.byte_13CA742, sizeof(_s6.byte_13CA742));
|
||||||
|
|
|
@ -5119,7 +5119,7 @@ static void loc_6B51C0(int rideIndex)
|
||||||
|
|
||||||
ride = get_ride(rideIndex);
|
ride = get_ride(rideIndex);
|
||||||
|
|
||||||
if (RCT2_GLOBAL(0x0141F568, uint8) != RCT2_GLOBAL(0x013CA740, uint8))
|
if (gUnk141F568 != gUnk13CA740)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
w = window_get_main();
|
w = window_get_main();
|
||||||
|
@ -5170,7 +5170,7 @@ static void loc_6B51C0(int rideIndex)
|
||||||
*/
|
*/
|
||||||
static void ride_scroll_to_track_error(rct_xy_element *trackElement)
|
static void ride_scroll_to_track_error(rct_xy_element *trackElement)
|
||||||
{
|
{
|
||||||
if (!gGameCommandIsNetworked && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8)) {
|
if (!gGameCommandIsNetworked && gUnk141F568 == gUnk13CA740) {
|
||||||
rct_window *w = window_get_main();
|
rct_window *w = window_get_main();
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->base_height * 8);
|
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->base_height * 8);
|
||||||
|
|
|
@ -93,7 +93,7 @@ void park_init()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
RCT2_GLOBAL(0x013CA740, uint8) = 0;
|
gUnk13CA740 = 0;
|
||||||
gParkName = STR_UNNAMED_PARK;
|
gParkName = STR_UNNAMED_PARK;
|
||||||
gStaffHandymanColour = COLOUR_BRIGHT_RED;
|
gStaffHandymanColour = COLOUR_BRIGHT_RED;
|
||||||
gStaffMechanicColour = COLOUR_LIGHT_BLUE;
|
gStaffMechanicColour = COLOUR_LIGHT_BLUE;
|
||||||
|
|
Loading…
Reference in New Issue