diff options
author | James Brown | 2002-04-16 16:25:57 +0000 |
---|---|---|
committer | James Brown | 2002-04-16 16:25:57 +0000 |
commit | 9b7db10944ed6f77a330c26d09a548414d6b46e9 (patch) | |
tree | c08089cf0065b06edb3dbf62bd39dc987d32f34c | |
parent | 0eaa9b16b438a7413b6a0cf51b7d56afccbd5069 (diff) | |
download | scummvm-rg350-9b7db10944ed6f77a330c26d09a548414d6b46e9.tar.gz scummvm-rg350-9b7db10944ed6f77a330c26d09a548414d6b46e9.tar.bz2 scummvm-rg350-9b7db10944ed6f77a330c26d09a548414d6b46e9.zip |
Fix Indy4. Make invalid actor warnings -d only.
FIXME note: Need to track down why these invalid calls are happening
in the first place.
svn-id: r3960
-rw-r--r-- | script_v1.cpp | 7 | ||||
-rw-r--r-- | scummvm.cpp | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/script_v1.cpp b/script_v1.cpp index e33e87957f..88c5f5e1b2 100644 --- a/script_v1.cpp +++ b/script_v1.cpp @@ -1254,10 +1254,15 @@ void Scumm::o5_getActorMoving() void Scumm::o5_getActorRoom() { int temp; + Actor *act; getResultPos(); temp = getVarOrDirectByte(0x80); + + act = derefActorSafe(temp, "o5_getActorRoom"); + if (!act) + return; - setResult(derefActorSafe(temp, "o5_getActorRoom")->room); + setResult(act->room); } void Scumm::o5_getActorScale() diff --git a/scummvm.cpp b/scummvm.cpp index bfc430720d..a7201ee939 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -902,9 +902,8 @@ void Scumm::convertKeysToClicks() Actor *Scumm::derefActorSafe(int id, const char *errmsg) { if (id < 1 || id >= NUM_ACTORS) { - warning - ("Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.", - id, errmsg, vm.slot[_curExecScript].number, _opcode); + if (_debugMode) + warning("Invalid actor %d in %s (script %d, opcode 0x%x) - This is potentially a BIG problem.", id, errmsg, vm.slot[_curExecScript].number, _opcode); return NULL; } return derefActor(id); |