From 7f057e1e8d83a1dcb166515b0fae5676bdbf4f4a Mon Sep 17 00:00:00 2001 From: Dugi Date: Thu, 19 Dec 2024 22:59:06 +0100 Subject: [PATCH] Fix #841 --- lua/inventory/retaliation.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/inventory/retaliation.lua b/lua/inventory/retaliation.lua index f3473d5f..6e47446f 100644 --- a/lua/inventory/retaliation.lua +++ b/lua/inventory/retaliation.lua @@ -143,7 +143,8 @@ local function onshow(dialog, unit) for _, disable_record in ipairs(wml.array_access.get("disabled_defences", unit)) do -- Note when comparing: "index" is Lua array index (starts with 1), -- while order is C++ array index (starts with 0). - if disable_record.order + 1 == index then + -- Moreover, status.lua uses only the name, don't check if disable_record.order + 1 == index + if attack.name == disable_record.name then attack_only = false break end