diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2024-01-18 02:35:05 +0000 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2024-03-02 12:13:15 -0500 |
| commit | 6fa3aaf3d484e6ba3f3cbeea71fef5d7640ba591 (patch) | |
| tree | 55d9c22c619d4de4e740d16aa89807b6646a827c | |
| parent | 5194bd96f0102e1206f59aaba403ebd3b1f7a516 (diff) | |
Fix alternate scene header room paths (#9)
| -rw-r--r-- | OTRExporter/RoomExporter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OTRExporter/RoomExporter.cpp b/OTRExporter/RoomExporter.cpp index ebefd23..979a98b 100644 --- a/OTRExporter/RoomExporter.cpp +++ b/OTRExporter/RoomExporter.cpp @@ -354,7 +354,13 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite if (Globals::Instance->game != ZGame::MM_RETAIL) roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%i", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i)); else - roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%02d", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i)); + { + // Alt headers use the rooms from their parent room. For example we want SPOT00/SPOT00_room_00, not SPOT00/SPOT00Set_00A050_room_00 + if (room->zroomType == ZResourceType::AltHeader) + roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%02d", cmd->parent->GetName().c_str(), i)); + else + roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%02d", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i)); + } writer->Write(roomName); writer->Write(cmdRoom->romfile->rooms[i].virtualAddressStart); |
