Guard for nullptr

This commit is contained in:
Aaron van Geffen 2024-04-28 20:03:16 +02:00
parent f5f31496db
commit 2d74287b4b
1 changed files with 3 additions and 0 deletions

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;