#8936 closed patch
SCUMM: fix builtin load game screen for v1-v5
Reported by: | SF/quietust | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: |
Description
The "0xC0" case for o5_saveLoadGame currently fails to work correctly, appending the standard savegame extension to an uninitialized string and attempting to locate the filename. This results in numerous "FSNode::openForReading: FSNode does not exist" warnings when attempting to open the game's Load screen.
@@ -1259,13 +1259,14 @@ case 0xC0: // test if save exists + { Common::InSaveFile *file; bool avail_saves[100]; - char filename[256];
listSavegames(avail_saves, ARRAYSIZE(avail_saves)); - makeSavegameName(filename, slot, false); + Common::String filename = makeSavegameName(slot, false); - if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename))) { + if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename.c_str()))) { result = 6; // save file exists delete file; } else result = 7; // save file does not exist + } break;
The extra curly braces were needed to get rid of a compiler error (error C2361: initialization of 'filename' is skipped by 'default' label) in MSVC71; alternatively, filename could be declared at the top of the function and initialized with an empty string.
With this change, the builtin Load screens for Maniac Mansion (classic/enhanced), Zak McKracken (classic/enhanced), Indiana Jones and the Last Crusade (ega/vga), and Loom (ega) all work correctly.
Ticket imported from: #2258906. Ticket imported from: patches/1041.
Change History (3)
comment:1 by , 16 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
comment:3 by , 6 years ago
Component: | → Engine: SCUMM |
---|
Thanks, added to trunk.