Merge branch 'main' into feature/remove-warnings

This commit is contained in:
Cooldude2606
2026-09-06 00:31:28 +01:00
committed by GitHub
15 changed files with 526 additions and 530 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ Adds a commands that allow admins to jail and unjail
local Commands = require("modules/exp_commands")
local format_player_name = Commands.format_player_name_locale
local Jail = require("modules.exp_legacy.modules.control.jail") --- @dep modules.control.jail
local Jail = require("modules/exp_scenario/control/jail")
--- Puts a player into jail and removes all other roles.
Commands.new("jail", { "exp-commands_jail.description" })
@@ -12,10 +12,9 @@ local Commands = require("modules/exp_commands")
local format_player_name = Commands.format_player_name_locale
local Roles = require("modules/exp_roles")
local EntityProtection = require("modules.exp_legacy.modules.control.protection") --- @dep modules.control.protection
local format_string = string.format
local floor = math.floor
local EntityProtection = require("modules/exp_scenario/control/protection")
local get_entity_key = EntityProtection.get_entity_key
local get_area_key = EntityProtection.get_area_key
local Selection = require("modules/exp_util/selection")
local SelectEntities = Selection.connect("ExpCommand_ProtectEntity")
@@ -28,21 +27,6 @@ Storage.register({
renders = tbl.renders
end)
--- Get the key used in protected_entities
--- @param entity LuaEntity
--- @return string
local function get_entity_key(entity)
return format_string("%i,%i", floor(entity.position.x), floor(entity.position.y))
end
--- Get the key used in protected_areas
--- TODO expose this from EntityProtection
--- @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))
end
--- Show a protected entity to a player
--- @param player LuaPlayer
--- @param entity LuaEntity
@@ -232,6 +216,6 @@ end
return {
events = {
[EntityProtection.events.on_repeat_violation] = on_repeat_violation,
[EntityProtection.on_repeat_violation] = on_repeat_violation,
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ Adds commands relating to spectate and follow
]]
local Commands = require("modules/exp_commands")
local Spectate = require("modules.exp_legacy.modules.control.spectate") --- @dep modules.control.spectate
local Spectate = require("modules/exp_scenario/control/spectate")
--- Toggles spectator mode for the caller
Commands.new("spectate", { "exp-commands_spectate.description-spectate" })