Unless I'm doing something stupid, I think I found a bug where the method passed to ModUtil.mod.Path.Wrap is incorrectly being called twice?
Repro steps:
- In Hades 2, open
Scripts\KeepsakeLogic.lua and update AdvanceKeepsake to look like this:
function AdvanceKeepsake( fromTrait )
print("[Game] AdvanceKeepsake actually called")
-- Rest of method unchanged
- Create a mod that wraps
AdvanceKeepsake:
ModUtil.mod.Path.Wrap("AdvanceKeepsake", function(base, fromTrait)
local result = base(fromTrait)
printMsg("[Mod] AdvanceKeepsake wrapper called")
return result
end)
- In Hades 2, beat any room
Expected results:
Console shows this:
[Game] AdvanceKeepsake actually called
[Mod] AdvanceKeepsake wrapper called
Actual results:
Console shows this:
[Game] AdvanceKeepsake actually called
[Mod] AdvanceKeepsake wrapper called
[Mod] AdvanceKeepsake wrapper called
The exact code I am running is here:
https://github.com/BlueRaja/Hades-2-Mods/blob/main/FavorOfTheGods/incantations/odysseus_keepsake_progress.lua#L33
Unless I'm doing something stupid, I think I found a bug where the method passed to
ModUtil.mod.Path.Wrapis incorrectly being called twice?Repro steps:
Scripts\KeepsakeLogic.luaand updateAdvanceKeepsaketo look like this:AdvanceKeepsake:Expected results:
Console shows this:
Actual results:
Console shows this:
The exact code I am running is here:
https://github.com/BlueRaja/Hades-2-Mods/blob/main/FavorOfTheGods/incantations/odysseus_keepsake_progress.lua#L33