diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2024-01-18 02:35:05 +0000 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2025-03-29 13:50:21 -0400 |
| commit | 82070fe6ba394a2e61be4783ad282ee9cd48f75c (patch) | |
| tree | 507fb0b3aa4678492a02454f4ebda0bc4000a78e | |
| parent | 4fa3dc84f3f90b3b49cc8f9cc3336cd23dcf3738 (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); |
