1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Implemented map element remove. Small tidy of functions in game.c.

This commit is contained in:
Duncan Frost
2015-06-28 13:31:46 +01:00
parent e2403d5a9b
commit 5e3df22414
2 changed files with 13 additions and 3 deletions

View File

@@ -870,7 +870,7 @@ void rct2_exit_reason(rct_string_id title, rct_string_id body){
*/
void rct2_exit()
{
RCT2_CALLPROC_EBPSAFE(0x006E3879);
audio_close();
//Post quit message does not work in 0x6e3879 as its windows only.
openrct2_finish();
}
@@ -892,7 +892,7 @@ void game_load_or_quit_no_save_prompt()
game_do_command(0, 1, 0, 1, GAME_COMMAND_LOAD_OR_QUIT, 0, 0);
tool_cancel();
if (RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_5) {
RCT2_CALLPROC_EBPSAFE(0x0040705E);
// RCT2_CALLPROC_EBPSAFE(0x0040705E); Function not required resets cursor position.
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) &= ~INPUT_FLAG_5;
}
gGameSpeed = 1;

View File

@@ -2637,7 +2637,17 @@ int map_get_station(rct_map_element *mapElement)
*/
void map_element_remove(rct_map_element *mapElement)
{
RCT2_CALLPROC_X(0x0068B280, 0, 0, 0, 0, (int)mapElement, 0, 0);
if (!map_element_is_last_for_tile(mapElement)){
do{
*mapElement = *(mapElement + 1);
} while (!map_element_is_last_for_tile(++mapElement));
}
(mapElement - 1)->flags |= MAP_ELEMENT_FLAG_LAST_TILE;
mapElement->base_height = 0xFF;
if ((mapElement + 1) == RCT2_GLOBAL(0x00140E9A4, rct_map_element*)){
RCT2_GLOBAL(0x00140E9A4, rct_map_element*)--;
}
}
/**