animation_set: throw DukException for invalid animations

This commit is contained in:
Aaron van Geffen 2024-04-29 21:31:50 +02:00
parent f4cc60d974
commit 6c460c55a4
2 changed files with 2 additions and 2 deletions

View File

@ -883,7 +883,7 @@ namespace OpenRCT2::Scripting
auto newType = availableGuestAnimations.TryGet(groupKey);
if (newType == std::nullopt)
{
return;
throw DukException() << "Invalid animation for this guest (" << groupKey << ")";
}
auto* peep = GetGuest();

View File

@ -376,7 +376,7 @@ namespace OpenRCT2::Scripting
auto newType = animationGroups.TryGet(groupKey);
if (newType == std::nullopt)
{
return;
throw DukException() << "Invalid animation for this staff member (" << groupKey << ")";
}
peep->ActionSpriteType = peep->NextActionSpriteType = *newType;