Skip to content

Commit

Permalink
Add getApproachPos
Browse files Browse the repository at this point in the history
  • Loading branch information
ZH-Hristov authored Aug 29, 2023
1 parent 7d876a8 commit 829fcd9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/starfall/libs_sv/nextbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,18 @@ function nb_methods:removeApproachPos()
local nb = nbunwrap(self)
checkpermission(instance, nb, "nextbot.removeApproachPos")
nb.approachPos = nil
end
end

--- Returns the Vector the nextbot is trying to go to, set by setApproachPos
-- @server
-- @return Vector? Where the nextbot is trying to go to if it exists, else returns nil.
function nb_methods:getApproachPos()
local nb = nbunwrap(self)
if nb.approachPos then
return vwrap(nb.approachPos)
else return nil
end
end

--- Makes the nextbot try to go to a specified position using navmesh pathfinding.
-- @server
Expand Down

0 comments on commit 829fcd9

Please sign in to comment.