Add check to not rebake while navmesh is baking

refactor
John Montagu, the 4th Earl of Sandvich 2024-06-06 09:23:33 -07:00
parent c3ead0cdaa
commit 057aedca30
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
1 changed files with 4 additions and 1 deletions

View File

@ -59,10 +59,13 @@ public partial class DynamicDoor : StaticBody2D
{
// rebake navmesh so NPCs can correctly travel conditionally
GD.Print("Dynamic door updated; rebaking navmeshes...");
if (!navmesh.IsBaking())
{
navmesh.BakeNavigationPolygon();
}
}
}
}
public virtual void Open()
{