From 623e607dfd8cd75aa3beadadf48d4a967eb01718 Mon Sep 17 00:00:00 2001 From: zsilencer Date: Sun, 12 Apr 2015 14:24:43 -0600 Subject: [PATCH] game_command_fire_staff_member --- src/game.c | 4 ++-- src/peep/peep.h | 1 + src/peep/staff.c | 17 +++++++++++++++++ src/peep/staff.h | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/game.c b/src/game.c index bb366f4c7a..c78eae6ba9 100644 --- a/src/game.c +++ b/src/game.c @@ -905,7 +905,7 @@ static uint32 game_do_command_table[58] = { 0x006C5AE9, 0, // use new_game_command_table, original: 0x006BEFA1, 29 0, // 30 - 0x006C0B83, + 0, 0, 0, 0, @@ -968,7 +968,7 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = { game_command_emptysub, game_command_hire_new_staff_member, //game_command_emptysub, game_command_set_staff_patrol, // 30 - game_command_emptysub, + game_command_fire_staff_member, game_command_set_staff_order, game_command_set_park_name, game_command_set_park_open, diff --git a/src/peep/peep.h b/src/peep/peep.h index 381e95ea95..315dd46bd6 100644 --- a/src/peep/peep.h +++ b/src/peep/peep.h @@ -570,6 +570,7 @@ int peep_check_easteregg_name(int index, rct_peep *peep); int peep_get_easteregg_name_id(rct_peep *peep); int peep_is_mechanic(rct_peep *peep); int peep_has_food(rct_peep* peep); +void peep_sprite_remove(rct_peep* peep); void peep_window_state_update(rct_peep* peep); void peep_decrement_num_riders(rct_peep* peep); diff --git a/src/peep/staff.c b/src/peep/staff.c index 789bbfa8b9..01c4e10838 100644 --- a/src/peep/staff.c +++ b/src/peep/staff.c @@ -282,6 +282,23 @@ void game_command_set_staff_patrol(int *eax, int *ebx, int *ecx, int *edx, int * *ebx = 0; } +/** + * + * rct2: 0x006C0B83 + */ +void game_command_fire_staff_member(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp) +{ + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = 40; + if(*ebx & GAME_COMMAND_FLAG_APPLY){ + window_close_by_class(WC_FIRE_PROMPT); + uint16 sprite_id = *edx; + rct_peep *peep = &g_sprite_list[sprite_id].peep; + RCT2_CALLPROC_X(0x0069A512, 0, 0, 0, 0, (int)peep, 0, 0); + peep_sprite_remove(peep); + } + *ebx = 0; +} + /* * Updates the colour of the given staff type. */ diff --git a/src/peep/staff.h b/src/peep/staff.h index 87be022900..9e2ea86876 100644 --- a/src/peep/staff.h +++ b/src/peep/staff.h @@ -53,6 +53,7 @@ void game_command_update_staff_colour(int *eax, int *ebx, int *ecx, int *edx, in void game_command_hire_new_staff_member(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp); void game_command_set_staff_order(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp); void game_command_set_staff_patrol(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp); +void game_command_fire_staff_member(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp); void update_staff_colour(uint8 staffType, uint16 color); uint16 hire_new_staff_member(uint8 staffType);