M4: Add guard against moving to invalid rooms in mine

This commit is contained in:
Paul Gilbert 2024-02-07 18:38:34 -08:00
parent 5ac50d8154
commit 657a684415

View File

@ -470,6 +470,7 @@ void Mine::mine_travel_link(int16 takeLink) {
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get this mine room info
_entranceDoor = _mineRoomInfo.door[takeLink]; // Get which door to enter from in new room
mineRoomIndex = _mineRoomInfo.link[takeLink]; // Get which link to take
assert(mineRoomIndex != -1);
_mineRoomInfo = MINE_INFO[mineRoomIndex]; // Get new mine room info from new index
_presentSceneID = _mineRoomInfo.scene_id; // Set the scene ID