From bdd6ac63bd8d0858db04450d44fdcdc05fae3385 Mon Sep 17 00:00:00 2001 From: Mickael Cagnion Date: Sat, 7 Nov 2026 21:46:07 +0100 Subject: [PATCH] Stop source filters hiding tagged mods in Inc. from Tree Queries filtered by source also applied the filter to the multipliers and conditions read by each mod's tags. Tree mods scaled by weapon sockets then read 0 sockets and dropped out of the Inc. from Tree lines and of sidebar lines such as %Inc Life from Tree. The source now only selects which mods a query reads. --- spec/System/TestModStore_spec.lua | 10 ++++++++++ src/Classes/ModStore.lua | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 spec/System/TestModStore_spec.lua diff --git a/spec/System/TestModStore_spec.lua b/spec/System/TestModStore_spec.lua new file mode 100644 index 00000000000..d46fb4f3b3a --- /dev/null +++ b/spec/System/TestModStore_spec.lua @@ -0,0 +1,10 @@ +describe("ModStore source filter", function() + it("selects mods without filtering what their tags read", function() + local modDB = new("ModDB"):ModDB() + modDB:NewMod("Multiplier:Socket", "BASE", 1, "Item Sockets") + modDB:NewMod("Life", "INC", 12, "Tree:1", { type = "Multiplier", var = "Socket" }) + modDB:NewMod("Life", "INC", 30, "Item:1") + + assert.are.equals(12, modDB:Sum("INC", { source = "Tree" }, "Life")) + end) +end) diff --git a/src/Classes/ModStore.lua b/src/Classes/ModStore.lua index 0dd30e41d66..e7c4b46ac57 100644 --- a/src/Classes/ModStore.lua +++ b/src/Classes/ModStore.lua @@ -361,6 +361,11 @@ end ---@param globalLimits? table ---@return any function ModStoreClass:EvalMod(mod, cfg, globalLimits) + -- cfg.source only selects which mods a query reads. Multipliers and conditions read by tags can come from any source. + if cfg and cfg.source then + cfg = copyTable(cfg, true) + cfg.source = nil + end local value = mod.value local GetStat = self.GetStat local GetMultiplier = self.GetMultiplier