aboutsummaryrefslogtreecommitdiff
path: root/object.cpp
diff options
context:
space:
mode:
authorJames Brown2002-04-03 15:45:32 +0000
committerJames Brown2002-04-03 15:45:32 +0000
commitf896193a83e23596cecfed4d58494d1ccda29449 (patch)
tree8026556d9d8709bff18760d685a170d523f00b6a /object.cpp
parent60c0e580ab06dc0adcbf20cc5bae8dc31a672a9a (diff)
downloadscummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.tar.gz
scummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.tar.bz2
scummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.zip
Zak/Loom/Indy3 object flags fix. Only translates CLASS_TOUCHABLE at the moment.
svn-id: r3849
Diffstat (limited to 'object.cpp')
-rw-r--r--object.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/object.cpp b/object.cpp
index c7d2869a6e..3f291cf8f1 100644
--- a/object.cpp
+++ b/object.cpp
@@ -26,10 +26,18 @@
bool Scumm::getClass(int obj, int cls) {
checkRange(_numGlobalObjects-1, 0, obj, "Object %d out of range in getClass");
- cls &= 0x7F;
+
checkRange(32,1,cls,"Class %d out of range in getClass");
+ if (_features && GF_SMALL_HEADER) {
+ byte *oldClass = (byte*)&_classData[obj];
+ if (cls == 32) // CLASS_TOUCHABLE
+ cls = 23;
- return (_classData[obj] & (1<<(cls-1))) != 0;
+ return (oldClass[cls/8] & bit_table[cls&0x07]) != 0;
+ } else {
+ cls &= 0x7F;
+ return (_classData[obj] & (1<<(cls-1))) != 0;
+ }
}
void Scumm::putClass(int obj, int cls, bool set) {
@@ -874,7 +882,6 @@ void Scumm::SamInventoryHack(int obj) { // FIXME: Sam and Max hack
if (value == obj) return;
if (value == 0) {
_vars[179]++;
- printf("Adding item %d to slot %d\n", obj, base);
writeArray(178, 0, base, obj);
return;
}