Cleanup of ride_demolish

This commit is contained in:
jensj12 2018-04-02 21:56:29 +02:00 committed by Aaron van Geffen
parent d43d6b94bb
commit 50e3f8b4f6
7 changed files with 6 additions and 13 deletions

View File

@ -188,7 +188,7 @@ static void window_ride_demolish_mouseup(rct_window *w, rct_widgetindex widgetIn
switch (widgetIndex) {
case WIDX_DEMOLISH:
{
ride_demolish(w->number, GAME_COMMAND_FLAG_APPLY);
ride_action_modify(w->number, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
break;
}
case WIDX_CANCEL:

View File

@ -187,7 +187,7 @@ static void window_maze_construction_close(rct_window *w)
if (ride->overall_view.xy == RCT_XY8_UNDEFINED) {
sint32 savedPausedState = gGamePaused;
gGamePaused = 0;
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED);
gGamePaused = savedPausedState;
} else {
auto intent = Intent(WC_RIDE);

View File

@ -677,7 +677,7 @@ static void window_ride_construction_close(rct_window *w)
{
sint32 previousPauseState = gGamePaused;
gGamePaused = 0;
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY);
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
gGamePaused = previousPauseState;
}
}

View File

@ -456,7 +456,7 @@ static void window_ride_list_scrollmousedown(rct_window *w, sint32 scrollIndex,
// Open ride window
uint8 rideIndex = w->list_item_positions[index];
if (_quickDemolishMode && network_get_mode() != NETWORK_MODE_CLIENT) {
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY);
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
window_ride_list_refresh_list(w);
}
else {

View File

@ -215,12 +215,6 @@
#pragma endregion
#pragma region RideModifyAction
// For easy compatibility, should be removed
void ride_demolish(sint32 rideIndex, sint32 flags)
{
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, flags);
}
void ride_action_modify(sint32 rideIndex, sint32 modifyType, sint32 flags)
{
auto gameAction = RideDemolishAction(rideIndex, modifyType);

View File

@ -1129,7 +1129,6 @@ bool ride_entry_has_category(const rct_ride_entry * rideEntry, uint8 category);
sint32 ride_get_entry_index(sint32 rideType, sint32 rideSubType);
void ride_demolish(sint32 rideIndex, sint32 flags);
void ride_action_modify(sint32 rideIndex, sint32 modifyType, sint32 flags);
void ride_stop_peeps_queuing(sint32 rideIndex);

View File

@ -1377,7 +1377,7 @@ static sint32 track_design_place_maze(rct_track_td6 * td6, sint16 x, sint16 y, s
if (_trackDesignPlaceOperation == PTD_OPERATION_CLEAR_OUTLINES)
{
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_GHOST);
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_GHOST);
}
gTrackPreviewOrigin.x = x;
@ -1974,7 +1974,7 @@ static money32 place_track_design(sint16 x, sint16 y, sint16 z, uint8 flags, uin
if (cost == MONEY32_UNDEFINED || !(flags & GAME_COMMAND_FLAG_APPLY))
{
rct_string_id error_reason = gGameCommandErrorText;
ride_demolish(rideIndex, GAME_COMMAND_FLAG_APPLY);
ride_action_modify(rideIndex, RIDE_MODIFY_DEMOLISH, GAME_COMMAND_FLAG_APPLY);
gGameCommandErrorText = error_reason;
gCommandExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
*outRideIndex = rideIndex;