Cicatrization visuals reimplemented
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
local CommandsData = require("TOC/CommandsData")
|
||||
-------------------
|
||||
|
||||
@@ -9,21 +8,18 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
||||
if not isAdmin() then return end
|
||||
|
||||
local players = {}
|
||||
for _,v in ipairs(worldobjects) do
|
||||
|
||||
for x=v:getSquare():getX()-1,v:getSquare():getX()+1 do
|
||||
for y=v:getSquare():getY()-1,v:getSquare():getY()+1 do
|
||||
local sq = getCell():getGridSquare(x,y,v:getSquare():getZ());
|
||||
for _, v in ipairs(worldobjects) do
|
||||
for x = v:getSquare():getX() - 1, v:getSquare():getX() + 1 do
|
||||
for y = v:getSquare():getY() - 1, v:getSquare():getY() + 1 do
|
||||
local sq = getCell():getGridSquare(x, y, v:getSquare():getZ());
|
||||
if sq then
|
||||
for z=0,sq:getMovingObjects():size()-1 do
|
||||
for z = 0, sq:getMovingObjects():size() - 1 do
|
||||
local o = sq:getMovingObjects():get(z)
|
||||
if instanceof(o, "IsoPlayer") then
|
||||
|
||||
---@cast o IsoPlayer
|
||||
|
||||
local oId = o:getOnlineID()
|
||||
players[oId] = o
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -33,7 +29,6 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
||||
|
||||
|
||||
for _, pl in pairs(players) do
|
||||
|
||||
---@cast pl IsoPlayer
|
||||
|
||||
local clickedPlayerNum = pl:getOnlineID()
|
||||
@@ -43,10 +38,9 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
||||
context:addSubMenu(option, subMenu)
|
||||
|
||||
subMenu:addOption(getText("ContextMenu_Admin_ResetTOC"), nil, function()
|
||||
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayExecuteInitialization, {patientNum=clickedPlayerNum} )
|
||||
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayExecuteInitialization,
|
||||
{ patientNum = clickedPlayerNum })
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Events.OnFillWorldObjectContextMenu.Add(AddAdminTocOptions)
|
||||
Events.OnFillWorldObjectContextMenu.Add(AddAdminTocOptions)
|
||||
|
||||
Reference in New Issue
Block a user