mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactor explicit constructor usage in StaffSetCostumeAction
This commit is contained in:
parent
219d49aee1
commit
6600f813de
|
@ -58,21 +58,21 @@ GameActions::Result::Ptr StaffSetCostumeAction::Query() const
|
||||||
{
|
{
|
||||||
if (_spriteIndex >= MAX_ENTITIES)
|
if (_spriteIndex >= MAX_ENTITIES)
|
||||||
{
|
{
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
||||||
if (staff == nullptr)
|
if (staff == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto spriteType = EntertainerCostumeToSprite(_costume);
|
auto spriteType = EntertainerCostumeToSprite(_costume);
|
||||||
if (EnumValue(spriteType) > std::size(peep_slow_walking_types))
|
if (EnumValue(spriteType) > std::size(peep_slow_walking_types))
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
return std::make_unique<GameActions::Result>();
|
return std::make_unique<GameActions::Result>();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ GameActions::Result::Ptr StaffSetCostumeAction::Execute() const
|
||||||
if (staff == nullptr)
|
if (staff == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto spriteType = EntertainerCostumeToSprite(_costume);
|
auto spriteType = EntertainerCostumeToSprite(_costume);
|
||||||
|
|
Loading…
Reference in New Issue