Ticket #4248: save-iq-fix.patch
File save-iq-fix.patch, 1.9 KB (added by , 15 years ago) |
---|
-
engines/scumm/script_v5.cpp
1017 1017 */ 1018 1018 void ScummEngine_v5::updateIQPoints() { 1019 1019 int seriesIQ; 1020 // IQString[0..72] corresponds to each puzzle's IQ. 1021 // IQString[73] indicates that the IQ-file was loaded successfully and is always 0 when 1022 // the IQ is calculated, hence it will be ignored here. 1023 const int NUM_PUZZLES = 73; 1024 byte seriesIQString[NUM_PUZZLES]; 1025 byte *episodeIQString; 1020 1026 int episodeIQStringSize; 1021 byte *episodeIQString;1022 byte seriesIQString[73];1023 1027 1024 1028 // load string with IQ points given per puzzle in any savegame 1025 1029 // IMPORTANT: the resource string STRINGID_IQ_SERIES is only valid while … … 1032 1036 if (!episodeIQString) 1033 1037 return; 1034 1038 episodeIQStringSize = getResourceSize(rtString, STRINGID_IQ_EPISODE); 1035 if (episodeIQStringSize < 73)1039 if (episodeIQStringSize < NUM_PUZZLES) 1036 1040 return; 1037 1041 1038 1042 // merge episode and series IQ strings and calculate series IQ 1039 1043 seriesIQ = 0; 1040 // iterate over puzzles (each of the first 73 bytes corresponds to a puzzle's IQ)1041 for (int i = 0; i < 73; ++i) {1042 charpuzzleIQ = seriesIQString[i];1044 // iterate over puzzles 1045 for (int i = 0; i < NUM_PUZZLES ; ++i) { 1046 byte puzzleIQ = seriesIQString[i]; 1043 1047 // if puzzle is solved copy points to episode string 1044 1048 if (puzzleIQ > 0) 1045 1049 episodeIQString[i] = puzzleIQ; -
engines/scumm/scumm.cpp
2083 2083 } 2084 2084 2085 2085 void ScummEngine_v5::scummLoop_handleSaveLoad() { 2086 byte saveLoad = (_saveLoadFlag != 0); 2086 // copy saveLoadFlag as handleSaveLoad() resets it 2087 byte saveLoad = _saveLoadFlag; 2087 2088 2088 2089 ScummEngine::scummLoop_handleSaveLoad(); 2089 2090