TeamREPENTOGON / TeamREPENTOGON/REPENTOGON
Isaac.CreateTimer runs instantly in MC_POST_NEW_ROOM
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 345
- Forks
- 51
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 4
Description
If Isaac.CreateTimer is called in MC_POST_NEW_ROOM callback, it'll fire instantly upon entering the room even with high interval set. Whether the timer is set as persistent or not appears to have no obvious effect. If the function is set to run more than once, it'll fire with the correct delay after the first call.
Reproduction is as simple as running Isaac.CreateTimer in a function called by the MC_POST_NEW_ROOM callback.
local mod = RegisterMod("Test", 1)
local function PostNewRoom()
Isaac.CreateTimer(function ()
Isaac.Spawn(
EntityType.ENTITY_PICKUP,
PickupVariant.PICKUP_COLLECTIBLE,
CollectibleType.COLLECTIBLE_SAD_ONION,
Game():GetRoom():GetCenterPos(),
Vector.Zero,
nil
)
end, 60, 1, false)
end
mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, PostNewRoom)
Marking as low priority since there's a "good enough" workaround for now of wrapping the CreateTimer in another CreateTimer with 0 or 1 frame of interval.
local function PostNewRoom()
Isaac.CreateTimer(function ()
Isaac.CreateTimer(function ()
Isaac.Spawn(
EntityType.ENTITY_PICKUP,
PickupVariant.PICKUP_COLLECTIBLE,
CollectibleType.COLLECTIBLE_SAD_ONION,
Game():GetRoom():GetCenterPos(),
Vector.Zero,
nil
)
end, 30, 1, true)
end, 0, 1, true)
end
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
Start by running the MC_POST_NEW_ROOM reproduction with Isaac.CreateTimer and compare its behavior with timers created outside that callback. Trace the Isaac.CreateTimer and MC_POST_NEW_ROOM entry points to determine why a single-run timer fires immediately. Done means a timer created there respects its interval, including when persistent is false, while repeated timers retain their expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, 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