mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-21 19:41:11 +00:00
- fixed crash in actor iterator
Level pointer should passed to FActorIterator contructor regardless of 'last look actor' because the latter can be null https://forum.zdoom.org/viewtopic.php?t=63304
This commit is contained in:
parent
66d9ec00a7
commit
395d613912
2 changed files with 2 additions and 2 deletions
|
@ -124,7 +124,7 @@ public:
|
||||||
FActorIterator (FLevelLocals *l, int i) : Level(l), base (nullptr), id (i)
|
FActorIterator (FLevelLocals *l, int i) : Level(l), base (nullptr), id (i)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
FActorIterator (int i, AActor *start) : Level(start->Level), base (start), id (i)
|
FActorIterator (FLevelLocals *l, int i, AActor *start) : Level(l), base (start), id (i)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
AActor *Next ()
|
AActor *Next ()
|
||||||
|
|
|
@ -1340,7 +1340,7 @@ int P_LookForTID (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
actor->LastLookActor = nullptr;
|
actor->LastLookActor = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FActorIterator iterator (actor->TIDtoHate, actor->LastLookActor);
|
FActorIterator iterator (actor->Level, actor->TIDtoHate, actor->LastLookActor);
|
||||||
int c = (pr_look3() & 31) + 7; // Look for between 7 and 38 hatees at a time
|
int c = (pr_look3() & 31) + 7; // Look for between 7 and 38 hatees at a time
|
||||||
while ((other = iterator.Next()) != actor->LastLookActor)
|
while ((other = iterator.Next()) != actor->LastLookActor)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue