Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrb93 committed Aug 26, 2023
1 parent 77b3bb6 commit a8a4700
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lua/starfall/libs_sh/hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ function hologram_methods:removeEffects(effect)
holo:RemoveEffects(effect)
end

--- Removes all holograms created by the calling chip
--- Removes a hologram
-- @shared
function hologram_methods:remove()
if CLIENT and instance.data.render.isRendering then SF.Throw("Cannot remove while in rendering hook!", 2) end
Expand Down
2 changes: 0 additions & 2 deletions lua/starfall/libs_sv/navmesh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ return function(instance)
return lnavunwrap(self):PlaceOnGround(corner)
end


--- Removes a CNavArea from the Open List with the lowest cost to traverse to from the starting node, and returns it.
-- Requires the `navarea.openlist` permission
-- @return NavArea The CNavArea from the Open List with the lowest cost to traverse to from the starting node.
Expand All @@ -649,7 +648,6 @@ return function(instance)
return lnavwrap( lnavunwrap(self):PopOpenList() )
end


--- Removes the given NavArea.
function navarea_methods:remove()
local nav = navunwrap(self)
Expand Down
12 changes: 5 additions & 7 deletions lua/starfall/libs_sv/nextbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SF.RegisterType("NextBot", false, true, debug.getregistry().NextBot, "Entity")
SF.RegisterLibrary("nextbot")

registerprivilege("nextbot.create", "Create nextbot", "Allows the user to create nextbots.")
registerprivilege("nextbot.remove", "Remove a nextbot", "Allows the user to remove a nextbot.", {entites = {}})
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.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 = {}})
Expand Down Expand Up @@ -101,13 +102,10 @@ function nextbot_library.create(pos, mdl)
end

--- Removes the given nextbot.
function navarea_methods:remove()
local nav = navunwrap(self)
entList:remove(instance, nav)

local sensitive2sf, sf2sensitive = navarea_meta.sensitive2sf, navarea_meta.sf2sensitive
sensitive2sf[nav] = nil
sf2sensitive[self] = nil
function nextbot_library:remove()
local nb = nbunwrap(self)
checkpermission(instance, nb, "nextbot.remove")
entList:remove(instance, nb)
end

--- Checks if a user can spawn anymore nextbots.
Expand Down
4 changes: 2 additions & 2 deletions lua/starfall/sflib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ SF.EntManager = {
register = function(self, instance, ent)
ent:CallOnRemove("starfall_entity_onremove", self.onremove, self, instance)
self.entsByInstance[instance][ent] = true
self.limit:free(instance.player, -1)
self:free(instance.player, -1)
end,
remove = function(self, instance, ent)
if ent:IsValid() then
Expand All @@ -305,7 +305,7 @@ SF.EntManager = {
end,
onremove = function(ent, self, instance)
self.entsByInstance[instance][ent] = nil
self.limit:free(instance.player, 1)
self:free(instance.player, 1)
end,
clear = function(self, instance)
for ent in pairs(self.entsByInstance[instance]) do
Expand Down

0 comments on commit a8a4700

Please sign in to comment.