TeamREPENTOGON / REPENTOGON

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

Obtaining Neighbors from a Placed Room Crashes Game #425

Open Lunastela opened 3 months ago

Lunastela commented 3 months ago

Very niche issue but, when working with level generation, if you place a room using PlaceRoom (specifically using the LevelGeneratorEntry overload), that room will the run MC_PRE_LEVEL_PLACE_ROOM on the spot. This is great for detecting if the room is that type, as you can store a local variable telling the game that the next room will be your placed room. If you then do that, MC_PRE_LEVEL_PLACE_ROOM returns a corresponding LevelGeneratorRoom, which seems to crash the game immediately when using the method Neighbors(). I have no idea why this would be the case other than the fact the room was placed after LevelGenerator made rooms (which must be the case if you wish to make spawning patterns conditional, as you cannot access Room or RoomDescriptor information with the LevelGenerator methods.), and although this problem can be circumvented, it would be incredibly convenient if PlaceRoom returned neighbors out of the box.