From 6e469002dd465fbf3d1fbccc0a186189b918df59 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 26 Aug 2009 09:36:54 +0000 Subject: Formatting svn-id: r43754 --- engines/sci/engine/vm.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index f1b6889096..f05a290d94 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1624,7 +1624,8 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan reg_t addr; reg.offset += objlength; // Step over the last checked object objtype = scr->getHeap(reg.offset); - if (!objtype) break; + if (!objtype) + break; objlength = scr->getHeap(reg.offset + 2); @@ -1670,6 +1671,7 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan break; } } while (objtype != 0); + // And now a second pass to adjust objects and class pointers, and the general pointers objlength = 0; @@ -1679,7 +1681,9 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan reg_t addr; reg.offset += objlength; // Step over the last checked object objtype = scr->getHeap(reg.offset); - if (!objtype) break; + if (!objtype) + break; + objlength = scr->getHeap(reg.offset + 2); reg.offset += 4; // Step over header @@ -1715,7 +1719,7 @@ int script_instantiate_sci0(ResourceManager *resourceManager, SegManager *segMan reg.offset -= 4; // Step back on header - } while ((objtype != 0) && (((unsigned)reg.offset) < script->size - 2)); + } while (objtype != 0 && reg.offset < script->size - 2); if (relocation >= 0) segManager->scriptRelocate(make_reg(reg.segment, relocation)); -- cgit v1.2.3