TeamREPENTOGON / TeamREPENTOGON/REPENTOGON
returning a value in a MC_PRE_MUSIC_PLAY, MC_PRE_MUSIC_PLAY_JINGLE or MC_PRE_SFX_PLAY function prevents execution of other similar callbacks
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 345
- Forks
- 51
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 4
Description
if a mod uses a MC_PRE_MUSIC_PLAY, MC_PRE_MUSIC_PLAY_JINGLE or MC_PRE_SFX_PLAY function that returns a value any other mods that use those callbacks fail to run their functions (makes sense when returning false but wasn't expecting other return values to do this)
e.g. with this code only the top 3 functions get executed
function mod:prejingle(id)
Isaac.ConsoleOutput(id .. "j1\n")
return id+1
end
mod:AddCallback(ModCallbacks.MC_PRE_MUSIC_PLAY_JINGLE, mod.prejingle)
function mod:premusic(id)
Isaac.ConsoleOutput(id .. "m1\n")
return id+2
end
mod:AddCallback(ModCallbacks.MC_PRE_MUSIC_PLAY, mod.premusic)
function mod:presfx(id, Volume, Delay, Loop, Pitch, Pan)
Isaac.ConsoleOutput(id .. "s1\n")
return {id+3, Volume, Delay, Loop, Pitch, Pan}
end
mod:AddCallback(ModCallbacks.MC_PRE_SFX_PLAY, mod.presfx)
function mod:prejingle2(id)
Isaac.ConsoleOutput(id .. "j2\n")
return id+4
end
mod:AddCallback(ModCallbacks.MC_PRE_MUSIC_PLAY_JINGLE, mod.prejingle2)
function mod:premusic2(id)
Isaac.ConsoleOutput(id .. "m2\n")
return id+5
end
mod:AddCallback(ModCallbacks.MC_PRE_MUSIC_PLAY, mod.premusic2)
function mod:presfx2(id, Volume, Delay, Loop, Pitch, Pan)
Isaac.ConsoleOutput(id .. "s2\n")
return {id+6, Volume, Delay, Loop, Pitch, Pan}
end
mod:AddCallback(ModCallbacks.MC_PRE_SFX_PLAY, mod.presfx2)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the dispatch paths for MC_PRE_MUSIC_PLAY, MC_PRE_MUSIC_PLAY_JINGLE, and MC_PRE_SFX_PLAY, starting with the callback handling used by the script extender. Reproduce the supplied Lua callbacks and determine how returned values affect subsequent callbacks. Done means multiple registered callbacks execute while the existing return-value behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100