aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/script_v1.cpp b/script_v1.cpp
index 87ddf658a5..aaf2de02c0 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -825,19 +825,17 @@ void Scumm::o5_actorSetClass()
{
int act = getVarOrDirectWord(0x80);
int newClass;
-
+
while ((_opcode = fetchScriptByte()) != 0xFF) {
newClass = getVarOrDirectWord(0x80);
if (newClass == 0) {
_classData[act] = 0;
-
- if( _features & GF_SMALL_HEADER)
+ if((_features & GF_SMALL_HEADER) && act <= NUM_ACTORS)
{
Actor *a;
- a=derefActor(act);
+ a = derefActorSafe(act, "actorSetClass");
a->forceClip=0;
- }
-
+ }
continue;
}