aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/script_v1.cpp b/script_v1.cpp
index 5cde3ce9a0..5e7d8c7547 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -690,7 +690,7 @@ void Scumm::o5_actorFromPos() {
}
void Scumm::o5_actorSet() {
- byte convertTable[20] = {1,0,0,2,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20};
+ static const byte convertTable[20] = {1,0,0,2,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20};
int act = getVarOrDirectByte(0x80);
Actor *a;
int i,j;
@@ -815,7 +815,6 @@ FixRoom:
void Scumm::o5_actorSetClass() {
int act = getVarOrDirectWord(0x80);
int newClass;
- byte *oldClassData;
while ( (_opcode=fetchScriptByte()) != 0xFF) {
newClass = getVarOrDirectWord(0x80);
@@ -824,18 +823,10 @@ void Scumm::o5_actorSetClass() {
continue;
}
- if(_features & GF_SMALL_HEADER) {
- oldClassData=(byte*)&_classData[act];
- if (newClass&0x80)
- oldClassData[((newClass-1)&0x7f)/8] |= bit_table[((newClass-1)&0x07)];
- else
- oldClassData[((newClass-1)&0x7f)/8] &= bit_table[((newClass-1)&0x07)]^0xff;
- } else {
- if (newClass&0x80)
- putClass(act, newClass, 1);
- else
- putClass(act, newClass, 0);
- }
+ if (newClass&0x80)
+ putClass(act, newClass, 1);
+ else
+ putClass(act, newClass, 0);
}
}
@@ -1349,18 +1340,12 @@ void Scumm::o5_getVerbEntrypoint() {
void Scumm::o5_ifClassOfIs() {
int act,cls, b;
bool cond = true;
- byte *oldClass;
act = getVarOrDirectWord(0x80);
while ( (_opcode = fetchScriptByte()) != 0xFF) {
cls = getVarOrDirectWord(0x80);
- oldClass = (byte*)&_classData[act];
-
- if(_features & GF_SMALL_HEADER)
- b = oldClass[((cls-1)&0x7f)/8] & bit_table[((cls-1)&0x07)];
- else
- b = getClass(act, cls);
+ b = getClass(act, cls);
if (cls&0x80 && !b || !(cls&0x80) && b)
cond = false;