1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Fix #12577: Mistake made in refactor #12538 (#12579)

Loop called the peep window open only when nullptr. Added extra checks for nullptr on window open
This commit is contained in:
Duncan
2020-08-04 00:09:24 +01:00
committed by GitHub
parent 87953ace9b
commit 0809069e74
2 changed files with 5 additions and 1 deletions

View File

@@ -512,6 +512,10 @@ static Guest* GetGuest(rct_window* w)
*/
rct_window* window_guest_open(Peep* peep)
{
if (peep == nullptr)
{
return nullptr;
}
if (peep->AssignedPeepType == PeepType::Staff)
{
return window_staff_open(peep);

View File

@@ -1627,7 +1627,7 @@ rct_window* window_ride_open_vehicle(Vehicle* vehicle)
for (int32_t i = 0; i < 32 && numPeepsLeft > 0; i++)
{
Peep* peep = GetEntity<Peep>(vehicle->peep[i]);
if (peep != nullptr)
if (peep == nullptr)
continue;
numPeepsLeft--;