local Data = InitHashtable()
function Int2Unit(id)
SaveFogStateHandle(Data, 0, 0, ConvertFogState(id))
return LoadUnitHandle(Data, 0, 0)
end
local focused = nil ---@type unit
OnSyncString(function ()
focused = Int2Unit(tonumber(BlzGetTriggerSyncData()))
end)
-- returns the current main selected unit of the player.
function GetMainSelectedUnitExSync(p)
if p == GetLocalPlayer() then
SyncString(tostring(GetHandleId(GetMainSelectedUnit(GetSelectedUnitIndex()))))
end
return focused
end