landsandboat/scripts/commands/reloadnavmesh.lua
claywar 55de6a5440
Fix issues reported in command scripts
Additional nil checks
2024-08-25 12:01:53 -04:00

26 lines
609 B
Lua

-----------------------------------
-- func: reloadnavmesh
-- desc: Reload the navmesh for the current zone
-- note: This is for reloading the underlying navmesh object, is not intended
-- to do anything to runtime pathing
-----------------------------------
---@type TCommand
local commandObj = {}
commandObj.cmdprops =
{
permission = 5,
parameters = ''
}
commandObj.onTrigger = function(player)
local zone = player:getZone()
if not zone then
return
end
player:printToPlayer('Reloading Navmesh for ' .. zone:getName())
zone:reloadNavmesh()
end
return commandObj