Extra safety checks.

This commit is contained in:
Major Cooke 2024-02-22 18:20:40 -06:00 committed by Rachael Alexanderson
commit 257ddb520a
2 changed files with 3 additions and 2 deletions

View file

@ -2232,7 +2232,8 @@ DEFINE_ACTION_FUNCTION(AActor, ClearPath)
bool AActor::CanPathfind()
{
if ((!(flags9 & MF9_NOPATHING) && !(Sector->MoreFlags & SECMF_NOPATHING)) &&
if (Level->PathNodes.Size() > 0 &&
(!(flags9 & MF9_NOPATHING) && !(Sector->MoreFlags & SECMF_NOPATHING)) &&
(flags9 & MF9_PATHING || Level->flags3 & LEVEL3_PATHING))
{
if ((flags6 & MF6_NOFEAR))