diff options
author | James Brown | 2002-03-05 09:24:42 +0000 |
---|---|---|
committer | James Brown | 2002-03-05 09:24:42 +0000 |
commit | 5753e81beaa736275e0406d91bce9258fbbe8ac8 (patch) | |
tree | 812ab5e656d09ccd229ca4cfcedaf9cc861fd14a | |
parent | c994e8bc8bac812180aef96792021549e68df657 (diff) | |
download | scummvm-rg350-5753e81beaa736275e0406d91bce9258fbbe8ac8.tar.gz scummvm-rg350-5753e81beaa736275e0406d91bce9258fbbe8ac8.tar.bz2 scummvm-rg350-5753e81beaa736275e0406d91bce9258fbbe8ac8.zip |
Sam and Max inventory hack. Makes it work, but is nasty ;)
svn-id: r3644
-rw-r--r-- | object.cpp | 19 | ||||
-rw-r--r-- | scumm.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/object.cpp b/object.cpp index cc819a8d58..78ad2378a2 100644 --- a/object.cpp +++ b/object.cpp @@ -821,6 +821,22 @@ int Scumm::getInventorySlot() { error("Inventory full, %d max items", _maxInventoryItems); } +void Scumm::SamInventoryHack(int obj) { // FIXME: Sam and Max hack + int base = 6; + + while (base < 80) { + int value = readArray(178, 0, base); + 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; + } + base++; + } +} + void Scumm::setOwnerOf(int obj, int owner) { ScriptSlot *ss; if (owner==0) { @@ -833,6 +849,9 @@ void Scumm::setOwnerOf(int obj, int owner) { return; } } + if ((owner == 2) && (_gameId == GID_SAMNMAX)) + SamInventoryHack(obj); + putOwner(obj, owner); runHook(0); } @@ -1194,6 +1194,7 @@ struct Scumm { int getOwner(int obj); void putOwner(int obj, int owner); int getObjectRoom(int obj); + void SamInventoryHack(int obj); // FIXME: Sam and Max hack void main(); |