From 0a67426799fbfd49e7054a0287da904d2f0e5846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 17 Feb 2022 18:40:18 +0200 Subject: [PATCH] Add MAX_ENTITIES check in PeepPickupAction --- src/openrct2/actions/PeepPickupAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 80b3916661..6683e9c118 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -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);