TeamREPENTOGON / REPENTOGON

Script extender for The Binding of Isaac: Repentance
https://repentogon.com/
GNU General Public License v2.0
140 stars 16 forks source link

RoomTransition.StartBossIntro crashes the game #141

Open jsgnextortex opened 10 months ago

jsgnextortex commented 10 months ago

It makes its way to the actual function itself from lua just fine, but something may have changed in how zhl files are processed along the way that impacted this one in some way. Tried changing the int params to uint, since thats what ghidra says they are, but it didnt fix much.

Sylmir commented 10 months ago

The issue comes from the fact the game does not properly reset the ID of the current room when pressing R, using the "stage", "reseed" or "restart" commands. As the game uses the ID of the current room in StartBossIntro, if the ID refers to a no longer existing room then the game will crash accessing an invalid room descriptor.

I see two solutions:

  1. Find a way to fix the game not properly changing the ID of the current room, but this would require us to find every place where this behavior happens
  2. If the current room ID is invalid, then in the binder for StartBossIntro try to fix it. This doesn't solve the underlying issue, but requires a single fix