1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Guard for nullptr

This commit is contained in:
Aaron van Geffen
2024-04-28 20:03:16 +02:00
parent f5f31496db
commit 2d74287b4b

View File

@@ -497,6 +497,9 @@ std::optional<CoordsXY> Peep::UpdateWalkingAction(const CoordsXY& differenceLoc,
void Peep::ThrowUp()
{
auto* guest = As<Guest>();
if (guest == nullptr)
return;
guest->Hunger /= 2;
guest->NauseaTarget /= 2;