mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Final manual fixups
This commit is contained in:
@@ -15,7 +15,7 @@ local abs = math.abs
|
||||
local commands = {}
|
||||
|
||||
--- @param player LuaPlayer
|
||||
--- @param area ExpUtil_AABB.Box
|
||||
--- @param area BoundingBox.struct
|
||||
--- @return boolean
|
||||
local function location_break(player, area)
|
||||
local surface = player.surface -- Allow remote view
|
||||
|
||||
@@ -37,7 +37,7 @@ end
|
||||
|
||||
--- Get the key used in protected_areas
|
||||
--- TODO expose this from EntityProtection
|
||||
--- @param area ExpUtil_AABB.Box
|
||||
--- @param area BoundingBox.struct
|
||||
--- @return string
|
||||
local function get_area_key(area)
|
||||
return format_string("%i,%i", floor(area.left_top.x), floor(area.left_top.y))
|
||||
@@ -49,7 +49,7 @@ end
|
||||
local function show_protected_entity(player, entity)
|
||||
local key = get_entity_key(entity)
|
||||
if renders[player.index][key] then return end
|
||||
local selection_box = entity.selection_box --[[@as ExpUtil_AABB.Box]]
|
||||
local selection_box = entity.selection_box
|
||||
local rb = selection_box.right_bottom
|
||||
local position = entity.position
|
||||
renders[player.index][key] = rendering.draw_sprite{
|
||||
@@ -69,7 +69,7 @@ end
|
||||
--- Show a protected area to a player
|
||||
--- @param player LuaPlayer
|
||||
--- @param surface LuaSurface
|
||||
--- @param area ExpUtil_AABB.Box
|
||||
--- @param area BoundingBox.struct
|
||||
local function show_protected_area(player, surface, area)
|
||||
local key = get_area_key(area)
|
||||
if renders[player.index][key] then return end
|
||||
|
||||
@@ -55,8 +55,7 @@ Commands.new("get-roles", { "exp-commands_roles.description-get" })
|
||||
end
|
||||
|
||||
local last = #roles_formatted
|
||||
--- @diagnostic disable-next-line: need-check-nil
|
||||
roles_formatted[last] = roles_formatted[last][2]
|
||||
roles_formatted[last] = assert(roles_formatted[last])[2]
|
||||
|
||||
return Commands.status.success(response)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user