1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Add MAX_ENTITIES check in PeepPickupAction

This commit is contained in:
ζeh Matt
2022-02-17 18:40:18 +02:00
parent fcea5bc483
commit 0a67426799

View File

@@ -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);