diff options
-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); |