fix warnings

This commit is contained in:
in0finite 2022-04-16 23:50:03 +02:00
parent c570c4c0e7
commit 3ce6c2ab82

View file

@ -108,19 +108,14 @@ namespace SanAndreasUnity.Utilities
{
m_lastTimeWhenWarped = currentTime;
bool bWarp = false;
bool bSetDestination = false;
// here we sample position to prevent Unity to spam with warning messages saying that agent is
// not close to nav mesh
if (NavMesh.SamplePosition(myPosition, out var hit, this.warpSampleDistance, agent.areaMask)
&& agent.Warp(myPosition))
{
bWarp = true;
if (this.Destination.HasValue && agent.isOnNavMesh)
{
this.SetDestination();
bSetDestination = true;
}
}