mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 03:40:25 +00:00
SAGA2: Fix player iterator access in player.cpp
This commit is contained in:
parent
8aca55e10b
commit
291add3cd6
@ -1112,14 +1112,18 @@ PlayerActor *LivingPlayerActorIterator::first(void) {
|
||||
}
|
||||
|
||||
PlayerActor *LivingPlayerActorIterator::next(void) {
|
||||
if (index >= playerActors)
|
||||
return nullptr;
|
||||
|
||||
Actor *a = playerList[index].getActor();
|
||||
|
||||
while (a == NULL || a->isDead()) {
|
||||
if (++index >= playerActors) break;
|
||||
while (a == nullptr || a->isDead()) {
|
||||
if (++index >= playerActors)
|
||||
break;
|
||||
a = playerList[index].getActor();
|
||||
}
|
||||
|
||||
return (index < playerActors) ? &playerList[index++] : NULL;
|
||||
return (index < playerActors) ? &playerList[index++] : nullptr;
|
||||
}
|
||||
|
||||
} // end of namespace Saga2
|
||||
|
Loading…
Reference in New Issue
Block a user