mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add MAX_ENTITIES check in PeepPickupAction
This commit is contained in:
parent
fcea5bc483
commit
0a67426799
|
@ -37,7 +37,7 @@ void PeepPickupAction::Serialise(DataSerialiser& stream)
|
|||
|
||||
GameActions::Result PeepPickupAction::Query() const
|
||||
{
|
||||
if (_spriteId.IsNull())
|
||||
if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull())
|
||||
{
|
||||
log_error("Failed to pick up peep for sprite %d", _spriteId);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
|
||||
|
|
Loading…
Reference in New Issue