Skip to content

Commit

Permalink
add removeApproachPos
Browse files Browse the repository at this point in the history
  • Loading branch information
ZH-Hristov authored Aug 26, 2023
1 parent 2fc64f3 commit 764dbde
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/starfall/libs_sv/nextbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SF.RegisterLibrary("nextbot")
registerprivilege("nextbot.create", "Create nextbot", "Allows the user to create nextbots.")
registerprivilege("nextbot.setGotoPos", "Set nextbot goto pos", "Allows the user to set a vector pos for the nextbot to try and go to.", {entites = {}})
registerprivilege("nextbot.setApproachPos", "Nextbot approach goal", "Allows the user to make a nextbot approach a specified Vector.", {entites = {}})
registerprivilege("nextbot.removeApproachPos", "Nextbot approach goal", "Allows the user to remove the approach pos from a nextbot.", {entites = {}})
registerprivilege("nextbot.removeGotoPos", "Remove nextbot goto pos", "Allows the user to remove the goto pos from a nextbot.", {entites = {}})
registerprivilege("nextbot.playSequence", "Play nextbot sequence", "Allows the user to set an animation for the nextbot to play.", {entites = {}})
registerprivilege("nextbot.faceTowards", "Face nextbot towards", "Allows the user to make a nextbot face a position.", {entities = {}})
Expand Down Expand Up @@ -135,6 +136,14 @@ function nb_methods:setApproachPos(goal, goalweight)
nbunwrap(self).approachPos = vunwrap(goal)
end

--- Removes the "approach" position from the NextBot.
-- @server
function nb_methods:removeApproachPos()
local nb = nbunwrap(self)
checkpermission(instance, nb, "nextbot.removeApproachPos")
nb.approachPos = nil
end

--- Makes the nextbot try to go to a specified position using navmesh pathfinding.
-- @server
-- @param Vector gotopos The position the nextbot will continuosly try to go to.
Expand Down

0 comments on commit 764dbde

Please sign in to comment.