Fix for MI1 intro crash (experimental)
|Reported by:||eriktorbjorn||Owned by:||SF/ender|
|Game:||Monkey Island 1|
I don't quite understand the implications of this patch, and my track record hasn't been too good lately when it comes to implementing my proposed changes, so please check this carefully before applying.
The MI1 intro crashes, if you press escape at the right moment. I'm not exactly sure what the right moment is, but sometime after the LucasFilm logo, but not too long after.
What seems to happen is that ScummVM tries to find the address of a resource for room 0, which in turn is because it thinks it has found an object in that room. This didn't use to happen because when looking for an object we would search through _numObjectsInRoom objects, and that variable gets set to 0 for room 0. But nowadays it always searches through _numLocalObjects objects.
What this patch does is simply to move the code to clear out old room objects out of loadRoomObjects() / loadRoomObjectsSmall() and into a function of its own, and make sure it's called for the case where room is 0 as well. The new code doesn't behave exactly like the old since the function is called before initRoomSubBlocks() instead of after, but I hope that doesn't break anything.
Ticket imported from: #671031. Ticket imported from: patches/266.