mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use IsPeep in more places
This commit is contained in:
parent
63549dee57
commit
fed148648c
|
@ -620,7 +620,7 @@ static void window_title_command_editor_tool_down(
|
|||
uint16_t spriteIndex = info.sprite->generic.sprite_index;
|
||||
uint16_t spriteIdentifier = info.sprite->generic.sprite_identifier;
|
||||
bool validSprite = false;
|
||||
if (spriteIdentifier == SPRITE_IDENTIFIER_PEEP)
|
||||
if (info.sprite->IsPeep())
|
||||
{
|
||||
validSprite = true;
|
||||
auto peep = GET_PEEP(spriteIndex);
|
||||
|
|
|
@ -56,7 +56,7 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t
|
|||
|
||||
if (highlightPathIssues)
|
||||
{
|
||||
if (spr->generic.sprite_identifier == SPRITE_IDENTIFIER_PEEP)
|
||||
if (spr->IsPeep())
|
||||
{
|
||||
Peep* peep = (Peep*)spr;
|
||||
if (!(peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_HANDYMAN))
|
||||
|
|
|
@ -5482,7 +5482,7 @@ void Guest::UpdateWalking()
|
|||
{
|
||||
sprite = get_sprite(sprite_id);
|
||||
|
||||
if (sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP)
|
||||
if (!sprite->IsPeep())
|
||||
continue;
|
||||
|
||||
if (sprite->peep.state != PEEP_STATE_WATCHING)
|
||||
|
@ -6068,7 +6068,7 @@ bool Guest::UpdateWalkingFindBench()
|
|||
{
|
||||
sprite = get_sprite(sprite_id);
|
||||
|
||||
if (sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP)
|
||||
if (!sprite->IsPeep())
|
||||
continue;
|
||||
|
||||
if (sprite->peep.state != PEEP_STATE_SITTING)
|
||||
|
@ -6262,8 +6262,7 @@ static void peep_update_walking_break_scenery(Peep* peep)
|
|||
{
|
||||
sprite = get_sprite(sprite_id);
|
||||
|
||||
if ((sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP) || (sprite->peep.state != PEEP_STATE_SITTING)
|
||||
|| (peep->z != sprite->peep.z))
|
||||
if (!sprite->IsPeep() || (sprite->peep.state != PEEP_STATE_SITTING) || (peep->z != sprite->peep.z))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -324,7 +324,7 @@ const bool gSpriteTypeToSlowWalkMap[] = {
|
|||
|
||||
// clang-format on
|
||||
|
||||
bool rct_sprite::IsPeep()
|
||||
bool rct_sprite::IsPeep() const
|
||||
{
|
||||
return peep.sprite_identifier == SPRITE_IDENTIFIER_PEEP;
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ Peep* try_get_guest(uint16_t spriteIndex)
|
|||
rct_sprite* sprite = try_get_sprite(spriteIndex);
|
||||
if (sprite == nullptr)
|
||||
return nullptr;
|
||||
if (sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP)
|
||||
if (!sprite->IsPeep())
|
||||
return nullptr;
|
||||
if (sprite->peep.type != PEEP_TYPE_GUEST)
|
||||
return nullptr;
|
||||
|
@ -2693,7 +2693,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle
|
|||
for (rct_sprite* sprite; sprite_id != SPRITE_INDEX_NULL; sprite_id = sprite->generic.next_in_quadrant)
|
||||
{
|
||||
sprite = get_sprite(sprite_id);
|
||||
if (sprite->generic.sprite_identifier == SPRITE_IDENTIFIER_PEEP)
|
||||
if (sprite->IsPeep())
|
||||
{
|
||||
Peep* other_peep = reinterpret_cast<Peep*>(sprite);
|
||||
if (other_peep->state != PEEP_STATE_WALKING)
|
||||
|
|
|
@ -419,7 +419,7 @@ void footpath_interrupt_peeps(const CoordsXYZ& footpathPos)
|
|||
{
|
||||
auto* entity = get_sprite(spriteIndex);
|
||||
uint16_t nextSpriteIndex = entity->generic.next_in_quadrant;
|
||||
if (entity->generic.sprite_identifier == SPRITE_IDENTIFIER_PEEP)
|
||||
if (entity->IsPeep())
|
||||
{
|
||||
Peep* peep = &entity->peep;
|
||||
if (peep->state == PEEP_STATE_SITTING || peep->state == PEEP_STATE_WATCHING)
|
||||
|
|
|
@ -202,7 +202,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc)
|
|||
for (; spriteIdx != SPRITE_INDEX_NULL; spriteIdx = sprite->generic.next_in_quadrant)
|
||||
{
|
||||
sprite = get_sprite(spriteIdx);
|
||||
if (sprite->generic.sprite_identifier != SPRITE_IDENTIFIER_PEEP)
|
||||
if (!sprite->IsPeep())
|
||||
continue;
|
||||
|
||||
peep = &sprite->peep;
|
||||
|
|
|
@ -268,7 +268,7 @@ rct_sprite_checksum sprite_checksum()
|
|||
break;
|
||||
}
|
||||
|
||||
if (copy.generic.sprite_identifier == SPRITE_IDENTIFIER_PEEP)
|
||||
if (copy.IsPeep())
|
||||
{
|
||||
// Name is pointer and will not be the same across clients
|
||||
copy.peep.name = {};
|
||||
|
|
|
@ -133,7 +133,7 @@ union rct_sprite
|
|||
bool IsBalloon();
|
||||
bool IsDuck();
|
||||
bool IsMoneyEffect();
|
||||
bool IsPeep();
|
||||
bool IsPeep() const;
|
||||
Balloon* AsBalloon();
|
||||
Duck* AsDuck();
|
||||
MoneyEffect* AsMoneyEffect();
|
||||
|
|
Loading…
Reference in New Issue