diff options
author | James Brown | 2003-01-11 19:21:38 +0000 |
---|---|---|
committer | James Brown | 2003-01-11 19:21:38 +0000 |
commit | a579558cdbece24513e2a0844dcdf67655b117a3 (patch) | |
tree | bfe876eeb173d641666f17442c0ae9a3ecfd9f78 /scumm/script_v8.cpp | |
parent | 15decf5b157ce62ed9af5c78c31dfa69b93f700e (diff) | |
download | scummvm-rg350-a579558cdbece24513e2a0844dcdf67655b117a3.tar.gz scummvm-rg350-a579558cdbece24513e2a0844dcdf67655b117a3.tar.bz2 scummvm-rg350-a579558cdbece24513e2a0844dcdf67655b117a3.zip |
Fix lock/unlock object
svn-id: r6402
Diffstat (limited to 'scumm/script_v8.cpp')
-rw-r--r-- | scumm/script_v8.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 434b79e498..d287871447 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1325,22 +1325,34 @@ void Scumm_v8::o8_kernelSetFunctions() int len = getStackList(args, sizeof(args) / sizeof(args[0])); switch (args[0]) { - case 11: // lockObject -// warning("o8_kernelSetFunctions: lockObject(%d)", args[1]); - lock(rtFlObject, args[1]); // FIXME - no idea if this is right? -// getObjectIndex(args[1]); + case 11: { // lockObject + int objidx = getObjectIndex(args[1]); + if (objidx == -1) { + warning("Cannot find object %d to lock\n", args[1]); + break; + } + + lock(rtFlObject, objidx); + // if (ObjData.field28 != 0) { // ObjData.field32 = 1; // } break; - case 12: // unlockObject - warning("o8_kernelSetFunctions: unlockObject(%d)", args[1]); - unlock(rtFlObject, args[1]); // FIXME - no idea if this is right? -// getObjectIndex(args[1]); + } + case 12: { // unlockObject + int objidx = getObjectIndex(args[1]); + if (objidx == -1) { + warning("Cannot find object %d to unlock\n", args[1]); + break; + } + + unlock(rtFlObject, objidx); + // if (ObjData.field28 != 0) { // ObjData.field32 = 0; // } break; + } case 13: // remapCostume a = derefActorSafe(args[1], "o8_kernelSetFunctions:remapCostume"); assert(a); |