mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 07:13:07 +01:00
Use VALUE_OUF_OF_RANGE for spriteId checks
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
@@ -39,7 +39,8 @@ GameActions::Result StaffFireAction::Query() const
|
|||||||
if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull())
|
if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull())
|
||||||
{
|
{
|
||||||
LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId);
|
LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId);
|
||||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
return GameActions::Result(
|
||||||
|
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto staff = TryGetEntity<Staff>(_spriteId);
|
auto staff = TryGetEntity<Staff>(_spriteId);
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ GameActions::Result StaffSetCostumeAction::Query() const
|
|||||||
{
|
{
|
||||||
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
|
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
|
||||||
{
|
{
|
||||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
return GameActions::Result(
|
||||||
|
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ GameActions::Result StaffSetOrdersAction::Query() const
|
|||||||
{
|
{
|
||||||
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
|
if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull())
|
||||||
{
|
{
|
||||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND);
|
return GameActions::Result(
|
||||||
|
GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
auto* staff = TryGetEntity<Staff>(_spriteIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user