Remove old game commands

This commit is contained in:
duncanspumpkin 2019-03-16 20:47:54 +00:00
parent 77238c1e5e
commit 0b231c8b38
4 changed files with 6 additions and 97 deletions

View File

@ -1291,8 +1291,8 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = {
nullptr,
nullptr,
nullptr,
game_command_set_staff_patrol,
game_command_fire_staff_member,
nullptr,
nullptr,
nullptr,
nullptr,
game_command_set_park_open,

View File

@ -49,10 +49,10 @@ enum GAME_COMMAND
GAME_COMMAND_LOWER_WATER, // GA
GAME_COMMAND_SET_BRAKES_SPEED, // GA
GAME_COMMAND_HIRE_NEW_STAFF_MEMBER, // GA
GAME_COMMAND_SET_STAFF_PATROL,
GAME_COMMAND_FIRE_STAFF_MEMBER,
GAME_COMMAND_SET_STAFF_ORDERS, // GA
GAME_COMMAND_SET_PARK_NAME, // GA
GAME_COMMAND_SET_STAFF_PATROL, // GA
GAME_COMMAND_FIRE_STAFF_MEMBER, // GA
GAME_COMMAND_SET_STAFF_ORDERS, // GA
GAME_COMMAND_SET_PARK_NAME, // GA
GAME_COMMAND_SET_PARK_OPEN,
GAME_COMMAND_BUY_LAND_RIGHTS,
GAME_COMMAND_PLACE_PARK_ENTRANCE, // GA

View File

@ -82,93 +82,6 @@ void staff_reset_modes()
staff_update_greyed_patrol_areas();
}
/**
*
* rct2: 0x006C09D1
*/
void game_command_set_staff_patrol(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi,
[[maybe_unused]] int32_t* ebp)
{
if (*ebx & GAME_COMMAND_FLAG_APPLY)
{
int32_t x = *eax;
int32_t y = *ecx;
uint16_t sprite_id = *edx;
if (sprite_id >= MAX_SPRITES)
{
*ebx = MONEY32_UNDEFINED;
log_warning("Invalid sprite id %u", sprite_id);
return;
}
rct_sprite* sprite = get_sprite(sprite_id);
if (sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP || sprite->peep.type != PEEP_TYPE_STAFF)
{
*ebx = MONEY32_UNDEFINED;
log_warning("Invalid type of sprite %u for game command", sprite_id);
return;
}
Peep* peep = &sprite->peep;
int32_t patrolOffset = peep->staff_id * STAFF_PATROL_AREA_SIZE;
staff_toggle_patrol_area(peep->staff_id, x, y);
int32_t ispatrolling = 0;
for (int32_t i = 0; i < 128; i++)
{
ispatrolling |= gStaffPatrolAreas[patrolOffset + i];
}
gStaffModes[peep->staff_id] &= ~2;
if (ispatrolling)
{
gStaffModes[peep->staff_id] |= 2;
}
for (int32_t y2 = 0; y2 < 4; y2++)
{
for (int32_t x2 = 0; x2 < 4; x2++)
{
map_invalidate_tile_full((x & 0x1F80) + (x2 * 32), (y & 0x1F80) + (y2 * 32));
}
}
staff_update_greyed_patrol_areas();
}
*ebx = 0;
}
/**
*
* rct2: 0x006C0B83
*/
void game_command_fire_staff_member(
[[maybe_unused]] int32_t* eax, int32_t* ebx, [[maybe_unused]] int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi,
[[maybe_unused]] int32_t* edi, [[maybe_unused]] int32_t* ebp)
{
gCommandExpenditureType = RCT_EXPENDITURE_TYPE_WAGES;
if (*ebx & GAME_COMMAND_FLAG_APPLY)
{
window_close_by_class(WC_FIRE_PROMPT);
uint16_t sprite_id = *edx;
if (sprite_id >= MAX_SPRITES)
{
log_warning("Invalid game command, sprite_id = %u", sprite_id);
*ebx = MONEY32_UNDEFINED;
return;
}
Peep* peep = &get_sprite(sprite_id)->peep;
if (peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->type != PEEP_TYPE_STAFF)
{
log_warning(
"Invalid game command, peep->sprite_identifier = %u, peep->type = %u", peep->sprite_identifier, peep->type);
*ebx = MONEY32_UNDEFINED;
return;
}
peep_sprite_remove(peep);
}
*ebx = 0;
}
/**
* Hires a new staff member of the given type.
*/

View File

@ -75,10 +75,6 @@ void game_command_hire_new_staff_member(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_callback_hire_new_staff_member(
int32_t eax, int32_t ebx, int32_t ecx, int32_t edx, int32_t esi, int32_t edi, int32_t ebp);
void game_command_set_staff_patrol(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_fire_staff_member(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_set_staff_name(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_pickup_staff(