Skip to content

Commit

Permalink
Disable area reclaim command (FAForever#6297)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored Jul 6, 2024
1 parent 3e4d0af commit 7fa9c14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lua/SimCallbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ do
---@param data { Origin: number, Destination: Vector}
---@param selection Unit[]
Callbacks.ExtendReclaimOrder = function(data, selection)
do -- feature: area commands
return
end

-- verify selection
selection = SecureUnits(selection)
if (not selection) or TableEmpty(selection) then
Expand Down Expand Up @@ -773,7 +777,8 @@ do

local start = GetSystemTimeSecondsOnlyForProfileUse()
import("/lua/sim/commands/area-reclaim-order.lua").AreaReclaimProps(selection, ps, pe, Width, true)
SPEW("Time taken for area reclaim order: ", 1000 * (GetSystemTimeSecondsOnlyForProfileUse() - start), "miliseconds")
SPEW("Time taken for area reclaim order: ", 1000 * (GetSystemTimeSecondsOnlyForProfileUse() - start),
"miliseconds")
end

---@param data table
Expand All @@ -795,7 +800,7 @@ do
end

local target = lastCommand.target --[[@as Unit | Prop]]

local start = GetSystemTimeSecondsOnlyForProfileUse()
import("/lua/sim/commands/area-attack-ground-order.lua").AreaAttackOrder(selection,
{ lastCommand.x, lastCommand.y, lastCommand.z }, data.Radius)
Expand Down
10 changes: 6 additions & 4 deletions lua/ui/game/commandmode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,11 @@ end

---@param command UserCommand
local function OnReclaimIssued(command)
-- Area reclaim dragger, command mode only
if command.Target.EntityId and modeData.name == "RULEUCC_Reclaim" then
import("/lua/ui/game/hotkeys/area-reclaim-order.lua").AreaReclaimOrder(command)
end
-- feature: area commands
-- -- Area reclaim dragger, command mode only
-- if command.Target.EntityId and modeData.name == "RULEUCC_Reclaim" then
-- import("/lua/ui/game/hotkeys/area-reclaim-order.lua").AreaReclaimOrder(command)
-- end
end

---@param command UserCommand
Expand All @@ -564,6 +565,7 @@ end

---@param command UserCommand
local function OnAttackIssued(command)
-- feature: area commands
-- Area attack dragger, command mode only
if command.Target.Type == 'Position' and modeData.name == "RULEUCC_Attack" then
import("/lua/ui/game/hotkeys/area-attack-order.lua").AreaAttackOrder(command)
Expand Down

0 comments on commit 7fa9c14

Please sign in to comment.