Skip to content

[Bug] ModUtil.mod.Path.Wrap being double-called? #11

@BlueRaja

Description

@BlueRaja

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:

  1. 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
  1. 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)
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem right

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions