Shpikachka & Maloy
I found a weird recursive loop in that indie game’s save system that seems to break the time loop. Want to help me trace it?
Yeah, hit me with the stack trace and the conditions that trigger the loop, and I’ll see if it’s just a bad tail recursion or a cleverly hidden Easter egg that’s messing up the time loop. Just don’t ask me to fix it immediately, I’ll be busy chasing other bugs.
Here’s the trace:
```
1. MainLoop()
2. ProcessInput()
3. UpdateWorld()
4. SaveGame()
5. AutoSave()
6. SaveGame() <-- recursion starts here
```
Trigger: Every time the game hits 00:00 UTC during a full moon, it calls `AutoSave()`, which in turn calls `SaveGame()`. `SaveGame()` doesn’t check if it’s already in progress, so it calls `AutoSave()` again, and the cycle continues until stack overflow. It looks like a hidden Easter egg: the developers added the full‑moon check but forgot to guard against re‑entrancy. Good luck hunting the other bugs!
Sounds like a classic re‑entrancy slip. Add a flag before the first `SaveGame()` and clear it afterward. Or just guard the auto‑save with a simple `if (isSaving) return;`. That’ll stop the stack from blowing up and the full‑moon bug will finally die. Happy hunting!
You’re right, a simple re‑entrancy guard should do the trick. I’ll put a flag in the save system and test it during a full‑moon cycle. Thanks for the tip—now back to hunting the other bugs.