mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Remove deprecated function
peep_auto_position has been replaced with staff_autoposition_new_staff_member. This also fixes a comment and applies a type for an enum that uses the sign bit.
This commit is contained in:
committed by
duncanspumpkin
parent
135154571c
commit
1590bc8e6f
@@ -3864,87 +3864,6 @@ void pathfind_logging_disable()
|
||||
}
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
void peep_autoposition(rct_peep * newPeep)
|
||||
{
|
||||
// Find a location to place new staff member
|
||||
|
||||
newPeep->state = PEEP_STATE_FALLING;
|
||||
|
||||
sint16 x, y, z;
|
||||
uint32 count = 0;
|
||||
uint16 sprite_index;
|
||||
rct_peep * guest = nullptr;
|
||||
|
||||
// Count number of walking guests
|
||||
FOR_ALL_GUESTS(sprite_index, guest)
|
||||
{
|
||||
if (guest->state == PEEP_STATE_WALKING)
|
||||
++count;
|
||||
}
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
// Place staff at a random guest
|
||||
uint32 rand = scenario_rand_max(count);
|
||||
FOR_ALL_GUESTS(sprite_index, guest)
|
||||
{
|
||||
if (guest->state == PEEP_STATE_WALKING)
|
||||
{
|
||||
if (rand == 0)
|
||||
break;
|
||||
--rand;
|
||||
}
|
||||
}
|
||||
|
||||
x = guest->x;
|
||||
y = guest->y;
|
||||
z = guest->z;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No walking guests; pick random park entrance
|
||||
count = 0;
|
||||
uint8 i;
|
||||
for (i = 0; i < MAX_PARK_ENTRANCES; ++i)
|
||||
{
|
||||
if (gParkEntrances[i].x != LOCATION_NULL)
|
||||
++count;
|
||||
}
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
uint32 rand = scenario_rand_max(count);
|
||||
for (i = 0; i < MAX_PARK_ENTRANCES; ++i)
|
||||
{
|
||||
if (gParkEntrances[i].x != LOCATION_NULL)
|
||||
{
|
||||
if (rand == 0)
|
||||
break;
|
||||
--rand;
|
||||
}
|
||||
}
|
||||
|
||||
uint8 dir = gParkEntrances[i].direction;
|
||||
x = gParkEntrances[i].x;
|
||||
y = gParkEntrances[i].y;
|
||||
z = gParkEntrances[i].z;
|
||||
x += 16 + ((dir & 1) == 0 ? ((dir & 2) ? 32 : -32) : 0);
|
||||
y += 16 + ((dir & 1) == 1 ? ((dir & 2) ? -32 : 32) : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No more options; user must pick a location
|
||||
newPeep->state = PEEP_STATE_PICKED;
|
||||
x = newPeep->x;
|
||||
y = newPeep->y;
|
||||
z = newPeep->z;
|
||||
}
|
||||
}
|
||||
|
||||
sprite_move(x, y, z + 16, (rct_sprite *)newPeep);
|
||||
invalidate_sprite_2((rct_sprite *)newPeep);
|
||||
}
|
||||
|
||||
void increment_guests_in_park()
|
||||
{
|
||||
if (gNumGuestsInPark < UINT16_MAX)
|
||||
|
||||
@@ -337,7 +337,7 @@ enum PEEP_ACTION_SPRITE_TYPE
|
||||
PEEP_ACTION_SPRITE_TYPE_WITHDRAW_MONEY = 36
|
||||
};
|
||||
|
||||
enum PEEP_FLAGS
|
||||
enum PEEP_FLAGS : uint32
|
||||
{
|
||||
PEEP_FLAGS_LEAVING_PARK = (1 << 0),
|
||||
PEEP_FLAGS_SLOW_WALK = (1 << 1),
|
||||
@@ -990,8 +990,6 @@ void pathfind_logging_enable(rct_peep * peep);
|
||||
void pathfind_logging_disable();
|
||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||
|
||||
void peep_autoposition(rct_peep * newPeep);
|
||||
|
||||
void increment_guests_in_park();
|
||||
void increment_guests_heading_for_park();
|
||||
void decrement_guests_in_park();
|
||||
|
||||
@@ -525,8 +525,8 @@ void game_command_fire_staff_member(sint32 * eax, sint32 * ebx, sint32 * ecx, si
|
||||
}
|
||||
|
||||
/**
|
||||
* Hires a new staff member of the given type. If the hire cannot be completed (eg. the maximum
|
||||
* number of staff is reached or there are too many people in the game) it returns 0xFFFF.
|
||||
* Hires a new staff member of the given type. If the hire cannot be completed (eg. the maximum number of staff is reached or
|
||||
* there are too many peeps) it returns SPRITE_INDEX_NULL.
|
||||
*/
|
||||
uint16 hire_new_staff_member(uint8 staffType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user