Skip to content

Commit

Permalink
SCI2+: Set the correct segment for SCI32 strings/arrays when loading
Browse files Browse the repository at this point in the history
This was an omission, observed after a discussion with clone2727
  • Loading branch information
bluegr committed Feb 14, 2011
1 parent 5012917 commit 8ef4594
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions engines/sci/engine/savegame.cpp
Expand Up @@ -144,17 +144,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
SegmentType type = (s.isSaving() && mobj) ? mobj->getType() : SEG_TYPE_INVALID;
s.syncAsUint32LE(type);

// If we were saving and mobj == 0, or if we are loading and this is an
// entry marked as empty -> skip to next
if (type == SEG_TYPE_INVALID)
if (type == SEG_TYPE_HUNK) {
// Don't save or load HunkTable segments
continue;

// Don't save or load HunkTable segments
if (type == SEG_TYPE_HUNK)
} else if (type == SEG_TYPE_INVALID) {
// If we were saving and mobj == 0, or if we are loading and this is an
// entry marked as empty -> skip to next
continue;

// Don't save or load the obsolete system string segments
if (type == 5) {
} else if (type == 5) {
// Don't save or load the obsolete system string segments
if (s.isSaving()) {
continue;
} else {
Expand All @@ -169,6 +167,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
continue;
}
}
#ifdef ENABLE_SCI32
else if (type == SEG_TYPE_ARRAY) {
// Set the correct segment for SCI32 arrays
_arraysSegId = i;
} else if (type == SEG_TYPE_STRING) {
// Set the correct segment for SCI32 strings
_stringSegId = i;
}
#endif

if (s.isLoading())
mobj = SegmentObj::createSegmentObj(type);
Expand All @@ -178,7 +185,6 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
// Let the object sync custom data
mobj->saveLoadWithSerializer(s);


if (type == SEG_TYPE_SCRIPT) {
Script *scr = (Script *)mobj;

Expand Down

0 comments on commit 8ef4594

Please sign in to comment.