1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 08:14:38 +01:00

Use more specific types where appropriate (#14388)

It takes marginally more time to get a Peep than a Guest/Staff so may as well go straight to the correct type
This commit is contained in:
Duncan
2021-03-25 08:44:25 +00:00
committed by GitHub
parent 1be7457e30
commit 0a47d2157a
7 changed files with 44 additions and 54 deletions

View File

@@ -39,7 +39,7 @@ void GuestSetFlagsAction::Serialise(DataSerialiser& stream)
GameActions::Result::Ptr GuestSetFlagsAction::Query() const
{
Peep* peep = TryGetEntity<Peep>(_peepId);
auto* peep = TryGetEntity<Guest>(_peepId);
if (peep == nullptr)
{
log_error("Used invalid sprite index for peep: %u", static_cast<uint32_t>(_peepId));
@@ -50,7 +50,7 @@ GameActions::Result::Ptr GuestSetFlagsAction::Query() const
GameActions::Result::Ptr GuestSetFlagsAction::Execute() const
{
Peep* peep = TryGetEntity<Peep>(_peepId);
auto* peep = TryGetEntity<Guest>(_peepId);
if (peep == nullptr)
{
log_error("Used invalid sprite index for peep: %u", static_cast<uint32_t>(_peepId));