mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
Loop called the peep window open only when nullptr. Added extra checks for nullptr on window open
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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--;
|
||||
|
||||
Reference in New Issue
Block a user