1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Added more of demolish. Fixed bug in window_close

This commit is contained in:
Duncan Frost
2014-12-20 11:14:26 +00:00
parent 749bd48f3d
commit a96bf872bf
4 changed files with 19 additions and 7 deletions

View File

@@ -470,10 +470,15 @@ void window_close(rct_window* window)
if (window == NULL)
return;
// Make a copy of the window class and number incase
// the window order is changed by the close event.
rct_windowclass cls = window->classification;
rct_windownumber number = window->number;
// Call close event of window
RCT2_CALLPROC_X(window->event_handlers[WE_CLOSE], 0, 0, 0, 0, (int)window, 0, 0);
window = window_find_by_number(window->classification, window->number);
window = window_find_by_number(cls, number);
// Remove viewport
if (window->viewport != NULL) {

View File

@@ -481,7 +481,7 @@ static rct_window *ride_create_or_find_construction_window(int rideIndex)
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex;
w = window_construction_open(rideIndex);
} else {
RCT2_CALLPROC_X(0x006C9627, 0, 0, 0, 0, 0, 0, 0);
sub_6C9627();
RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex;
}
@@ -712,7 +712,7 @@ void sub_6C96C0()
RCT2_CALLPROC_X(0x006C96C0, 0, 0, 0, 0, 0, 0, 0);
}
static void sub_6C9627()
void sub_6C9627()
{
switch (RCT2_GLOBAL(0x00F440A6, uint8)) {
case 3:

View File

@@ -628,6 +628,8 @@ rct_ride_measurement *ride_get_measurement(int rideIndex, rct_string_id *message
void ride_breakdown_add_news_item(int rideIndex);
rct_peep *ride_find_closest_mechanic(rct_ride *ride, int forInspection);
int sub_6CC3FB(int rideIndex);
void sub_6C9627();
int sub_6C683D(int x, int y, int z, int direction, int type, int esi, int edi, int ebp);
void ride_set_map_tooltip(rct_map_element *mapElement);
int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint16 sampleRate, uint32 position, uint8 *tuneId);
void ride_music_update_final();

View File

@@ -203,7 +203,7 @@ void window_construction_close(){
window_get_register(w);
RCT2_CALLPROC_X(0x006C9627, 0, 0, 0, 0, 0, 0, 0);
sub_6C9627();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
@@ -234,7 +234,7 @@ void window_construction_maze_close(){
window_get_register(w);
RCT2_CALLPROC_X(0x006C9627, 0, 0, 0, 0, 0, 0, 0);
sub_6C9627();
viewport_set_visibility(0);
map_invalidate_map_selection_tiles();
@@ -304,7 +304,7 @@ void window_construction_mouseup_demolish(rct_window* w){
return;
RCT2_GLOBAL(0xF44070, uint32) = 0x80000000;
RCT2_CALLPROC_X(0x006C9627, 0, 0, 0, 0, 0, 0, 0);
sub_6C9627();
RCT2_GLOBAL(0xF440B8, uint8) = 3;
if (RCT2_GLOBAL(0xF440A6, uint8) == 1){
@@ -313,7 +313,12 @@ void window_construction_mouseup_demolish(rct_window* w){
if (RCT2_GLOBAL(0xF440A6, uint8) != 2){
//6c9cc4
//do this
int eax = RCT2_GLOBAL(0xF440A8, uint16),
ebx = RCT2_GLOBAL(0xF440AF, uint8) || (RCT2_GLOBAL(0xF440AE, uint8) << 8),
ecx = RCT2_GLOBAL(0xF440AA, uint16),
edx = RCT2_GLOBAL(0xF440AC, uint16);
sub_6C683D(eax, ecx, edx, RCT2_GLOBAL(0xF440AE, uint8), RCT2_GLOBAL(0xF440AF, uint8) & 0x3FF, 0, 0, 0);
}
int ride_id = RCT2_GLOBAL(0xF440A7, uint8);