mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 23:04:36 +01:00
Clean up some litter in the codebase (#9753)
13CA740 and 141F568 have been doing mostly nothing since the game action refacotr. Before that they didn't do much as I've never found any instance where the code was hit.
This commit is contained in:
@@ -78,9 +78,6 @@ std::string gCurrentLoadedPath;
|
||||
|
||||
bool gLoadKeepWindowsOpen = false;
|
||||
|
||||
uint8_t gUnk13CA740;
|
||||
uint8_t gUnk141F568;
|
||||
|
||||
uint32_t gCurrentTicks;
|
||||
uint32_t gCurrentRealTimeTicks;
|
||||
|
||||
@@ -297,10 +294,6 @@ void update_palette_effects()
|
||||
*/
|
||||
static int32_t game_check_affordability(int32_t cost, uint32_t flags)
|
||||
{
|
||||
// Only checked for game commands.
|
||||
if (gUnk141F568 & 0xF0)
|
||||
return cost;
|
||||
|
||||
if (finance_check_affordability(cost, flags))
|
||||
return cost;
|
||||
|
||||
@@ -419,12 +412,10 @@ int32_t game_do_command_p(
|
||||
{
|
||||
// Update money balance
|
||||
finance_payment(cost, gCommandExpenditureType);
|
||||
if (gUnk141F568 == gUnk13CA740)
|
||||
{
|
||||
// Create a +/- money text effect
|
||||
if (cost != 0 && game_is_not_paused())
|
||||
rct_money_effect::Create(cost);
|
||||
}
|
||||
|
||||
// Create a +/- money text effect
|
||||
if (cost != 0 && game_is_not_paused())
|
||||
rct_money_effect::Create(cost);
|
||||
}
|
||||
|
||||
// Start autosave timer after game command
|
||||
@@ -441,9 +432,8 @@ int32_t game_do_command_p(
|
||||
gGameCommandNestLevel--;
|
||||
|
||||
// Show error window
|
||||
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && gUnk141F568 == gUnk13CA740
|
||||
&& !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED)
|
||||
&& !(flags & GAME_COMMAND_FLAG_GHOST))
|
||||
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)
|
||||
&& !(flags & GAME_COMMAND_FLAG_NETWORKED) && !(flags & GAME_COMMAND_FLAG_GHOST))
|
||||
{
|
||||
context_show_error(gGameCommandErrorTitle, gGameCommandErrorText);
|
||||
}
|
||||
|
||||
@@ -153,9 +153,6 @@ extern std::string gCurrentLoadedPath;
|
||||
|
||||
extern bool gLoadKeepWindowsOpen;
|
||||
|
||||
extern uint8_t gUnk13CA740;
|
||||
extern uint8_t gUnk141F568;
|
||||
|
||||
void game_increase_game_speed();
|
||||
void game_reduce_game_speed();
|
||||
|
||||
|
||||
@@ -198,9 +198,6 @@ void GameState::Update()
|
||||
|
||||
context_update_map_tooltip();
|
||||
|
||||
// Input
|
||||
gUnk141F568 = gUnk13CA740;
|
||||
|
||||
context_handle_input();
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static constexpr const CoordsXY SpiralSlideWalkingPath[64] = {
|
||||
};
|
||||
|
||||
/** rct2: 0x00981F4C, 0x00981F4E */
|
||||
static constexpr const LocationXY16 _WatchingPositionOffsets[] = {
|
||||
static constexpr const CoordsXY _WatchingPositionOffsets[] = {
|
||||
{ 7, 5 },
|
||||
{ 5, 25 },
|
||||
{ 25, 5 },
|
||||
@@ -2351,7 +2351,6 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount)
|
||||
|
||||
window_invalidate_by_number(WC_PEEP, sprite_index);
|
||||
|
||||
gUnk141F568 = gUnk13CA740;
|
||||
finance_payment(-amount, gCommandExpenditureType);
|
||||
|
||||
if (gConfigGeneral.show_guest_purchases && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
|
||||
@@ -5383,12 +5382,12 @@ void Guest::UpdateWalking()
|
||||
LITTER_TYPE_EMPTY_BURGER_BOX,
|
||||
LITTER_TYPE_EMPTY_CUP,
|
||||
};
|
||||
int32_t ebp = litter_types[scenario_rand() & 0x3];
|
||||
int32_t litterType = litter_types[scenario_rand() & 0x3];
|
||||
int32_t litterX = x + (scenario_rand() & 0x7) - 3;
|
||||
int32_t litterY = y + (scenario_rand() & 0x7) - 3;
|
||||
int32_t litterDirection = (scenario_rand() & 0x3);
|
||||
|
||||
litter_create(litterX, litterY, z, litterDirection, ebp);
|
||||
litter_create(litterX, litterY, z, litterDirection, litterType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5402,12 +5401,12 @@ void Guest::UpdateWalking()
|
||||
if (container & (1u << pos_stnd))
|
||||
break;
|
||||
|
||||
int32_t bp = 0;
|
||||
int32_t litterType = 0;
|
||||
|
||||
if (pos_stnd != 32)
|
||||
{
|
||||
item_standard_flags &= ~(1u << pos_stnd);
|
||||
bp = item_standard_litter[pos_stnd];
|
||||
litterType = item_standard_litter[pos_stnd];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5416,7 +5415,7 @@ void Guest::UpdateWalking()
|
||||
if (container & (1u << pos_extr))
|
||||
break;
|
||||
item_extra_flags &= ~(1u << pos_extr);
|
||||
bp = item_extra_litter[pos_extr];
|
||||
litterType = item_extra_litter[pos_extr];
|
||||
}
|
||||
|
||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
|
||||
@@ -5426,7 +5425,7 @@ void Guest::UpdateWalking()
|
||||
int32_t litterY = y + (scenario_rand() & 0x7) - 3;
|
||||
int32_t litterDirection = (scenario_rand() & 0x3);
|
||||
|
||||
litter_create(litterX, litterY, z, litterDirection, bp);
|
||||
litter_create(litterX, litterY, z, litterDirection, litterType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6002,12 +6001,12 @@ void Guest::UpdateUsingBin()
|
||||
UpdateSpriteType();
|
||||
continue;
|
||||
}
|
||||
uint8_t bp = item_standard_litter[cur_container];
|
||||
uint8_t litterType = item_standard_litter[cur_container];
|
||||
|
||||
int32_t litterX = x + (scenario_rand() & 7) - 3;
|
||||
int32_t litterY = y + (scenario_rand() & 7) - 3;
|
||||
|
||||
litter_create(litterX, litterY, z, scenario_rand() & 3, bp);
|
||||
litter_create(litterX, litterY, z, scenario_rand() & 3, litterType);
|
||||
item_standard_flags &= ~(1 << cur_container);
|
||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
|
||||
|
||||
@@ -6036,12 +6035,12 @@ void Guest::UpdateUsingBin()
|
||||
UpdateSpriteType();
|
||||
continue;
|
||||
}
|
||||
uint8_t bp = item_extra_litter[cur_container];
|
||||
uint8_t litterType = item_extra_litter[cur_container];
|
||||
|
||||
int32_t litterX = x + (scenario_rand() & 7) - 3;
|
||||
int32_t litterY = y + (scenario_rand() & 7) - 3;
|
||||
|
||||
litter_create(litterX, litterY, z, scenario_rand() & 3, bp);
|
||||
litter_create(litterX, litterY, z, scenario_rand() & 3, litterType);
|
||||
item_extra_flags &= ~(1 << cur_container);
|
||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ void S6Exporter::Export()
|
||||
std::memcpy(_s6.staff_modes, gStaffModes, sizeof(_s6.staff_modes));
|
||||
// unk_13CA73E
|
||||
// pad_13CA73F
|
||||
_s6.byte_13CA740 = gUnk13CA740;
|
||||
// unk_13CA740
|
||||
_s6.climate = gClimate;
|
||||
// pad_13CA741;
|
||||
// byte_13CA742
|
||||
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
std::memcpy(gStaffModes, _s6.staff_modes, sizeof(_s6.staff_modes));
|
||||
// unk_13CA73E
|
||||
// pad_13CA73F
|
||||
gUnk13CA740 = _s6.byte_13CA740;
|
||||
// unk_13CA740
|
||||
gClimate = _s6.climate;
|
||||
// pad_13CA741;
|
||||
// byte_13CA742
|
||||
|
||||
@@ -5124,9 +5124,6 @@ static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying)
|
||||
*/
|
||||
static void loc_6B51C0(const Ride* ride)
|
||||
{
|
||||
if (gUnk141F568 != gUnk13CA740)
|
||||
return;
|
||||
|
||||
rct_window* w = window_get_main();
|
||||
if (w == nullptr)
|
||||
return;
|
||||
@@ -5182,14 +5179,11 @@ static void loc_6B51C0(const Ride* ride)
|
||||
*/
|
||||
static void ride_scroll_to_track_error(CoordsXYE* trackElement)
|
||||
{
|
||||
if (gUnk141F568 == gUnk13CA740)
|
||||
rct_window* w = window_get_main();
|
||||
if (w != nullptr)
|
||||
{
|
||||
rct_window* w = window_get_main();
|
||||
if (w != nullptr)
|
||||
{
|
||||
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->base_height * 8);
|
||||
ride_modify(trackElement);
|
||||
}
|
||||
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->base_height * 8);
|
||||
ride_modify(trackElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,6 @@ money32 Park::GetCompanyValue() const
|
||||
void Park::Initialise()
|
||||
{
|
||||
Name = format_string(STR_UNNAMED_PARK, nullptr);
|
||||
gUnk13CA740 = 0;
|
||||
gStaffHandymanColour = COLOUR_BRIGHT_RED;
|
||||
gStaffMechanicColour = COLOUR_LIGHT_BLUE;
|
||||
gStaffSecurityColour = COLOUR_YELLOW;
|
||||
|
||||
Reference in New Issue
Block a user