I should stop trying to fix stuff while I'm falling asleep

This commit is contained in:
ZioPao
2024-10-22 01:09:41 +02:00
parent 00d5d83ea2
commit cd39e3f1f5

View File

@@ -8,16 +8,7 @@ local DataController = require("TOC/Controllers/DataController")
---@param context ISContextMenu ---@param context ISContextMenu
---@param worldobjects table ---@param worldobjects table
local function AddAdminTocOptions(playerNum, context, worldobjects) local function AddAdminTocOptions(playerNum, context, worldobjects)
if not(isClient() and isAdmin() or isDebugEnabled()) then return end
-- SP Check
if not isDebugEnabled() then return end
--TOC_DEBUG.print("Debug enabled")
-- MP check
if isClient() and not isAdmin() then return end
--TOC_DEBUG.print("MP and Admin")
local players = {} local players = {}
for _, v in ipairs(worldobjects) do for _, v in ipairs(worldobjects) do
@@ -80,6 +71,8 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
end) end)
end end
end end
end end
Events.OnFillWorldObjectContextMenu.Add(AddAdminTocOptions) Events.OnFillWorldObjectContextMenu.Add(AddAdminTocOptions)