mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 12:03:04 +00:00
use doubletime
This commit is contained in:
parent
482842a259
commit
8318a3c9b1
2 changed files with 4 additions and 4 deletions
|
@ -8,14 +8,14 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
|
|||
public PathNode? currentNode;
|
||||
public PathNode? destinationNode;
|
||||
public Vector3 moveDestination;
|
||||
public float timeWhenAttemptedToFindClosestNode = 0f;
|
||||
public double timeWhenAttemptedToFindClosestNode = 0;
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
this.currentNode = null;
|
||||
this.destinationNode = null;
|
||||
this.moveDestination = Vector3.zero;
|
||||
this.timeWhenAttemptedToFindClosestNode = 0f;
|
||||
this.timeWhenAttemptedToFindClosestNode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,10 +136,10 @@ namespace SanAndreasUnity.Behaviours.Peds.AI
|
|||
|
||||
public static void FindClosestWalkableNode(PathMovementData pathMovementData, Vector3 position)
|
||||
{
|
||||
if (Time.time - pathMovementData.timeWhenAttemptedToFindClosestNode < 2f) // don't attempt to find it every frame
|
||||
if (Time.timeAsDouble - pathMovementData.timeWhenAttemptedToFindClosestNode < 2f) // don't attempt to find it every frame
|
||||
return;
|
||||
|
||||
pathMovementData.timeWhenAttemptedToFindClosestNode = Time.time;
|
||||
pathMovementData.timeWhenAttemptedToFindClosestNode = Time.timeAsDouble;
|
||||
|
||||
var closestPathNodeToWalk = PedAI.GetClosestPathNodeToWalk(position);
|
||||
if (null == closestPathNodeToWalk)
|
||||
|
|
Loading…
Reference in a new issue