Skip to content

five-on-it / packages/ai/src/pathfinding / grantPlan

Function: grantPlan() ​

grantPlan(ai, npc, kind, goalX, goalZ, drift): boolean

Defined in: packages/ai/src/pathfinding.ts:210

Whether an NPC plans its kind (the walk or the drive) toward (goalX, goalZ) this tick: when it has none, its time has come, or the goal moved more than drift from the planned one, and the tick's plans are not spent. Sets the tick of its next plan: repathTicks on when granted, the next tick when denied.

Parameters ​

ai ​

AiWorld

npc ​

NpcState

kind ​

"path" | "route"

goalX ​

number

goalZ ​

number

drift ​

number

Returns ​

boolean