diff options
author | Max Horn | 2004-01-19 20:23:27 +0000 |
---|---|---|
committer | Max Horn | 2004-01-19 20:23:27 +0000 |
commit | 8e89f7d060ca5fac1efc7c244df91b678f7e2c9d (patch) | |
tree | 89c54551d525b732be98d953205ea15e837e5db3 /scumm/script_v6.cpp | |
parent | bcf805234115b0fc38e494672883919ed94e6cb6 (diff) | |
download | scummvm-rg350-8e89f7d060ca5fac1efc7c244df91b678f7e2c9d.tar.gz scummvm-rg350-8e89f7d060ca5fac1efc7c244df91b678f7e2c9d.tar.bz2 scummvm-rg350-8e89f7d060ca5fac1efc7c244df91b678f7e2c9d.zip |
moved the sam&max inventory hack into o6_setOwner
svn-id: r12520
Diffstat (limited to 'scumm/script_v6.cpp')
-rw-r--r-- | scumm/script_v6.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 545b5a2921..6ca3af6d35 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -925,6 +925,35 @@ void ScummEngine_v6::o6_setOwner() { int owner = pop(); int obj = pop(); + if ((owner == 2) && (_gameId == GID_SAMNMAX)) { + // TODO / FIXME: This hack was added a long time ago, in revision 1.28 + // of object.cpp in the old CVS module (see also here: + // http://cvs.sourceforge.net/viewcvs.py/scummvm/scummvm-old/object.cpp?r1=1.27&r2=1.28 + // Commited by Endy with message: + // "Sam and Max inventory hack. Makes it work, but is nasty ;)" + // + // Sadly, it's not quite clear what exactly the hack fixes. In a quick + // test I didn't find any place where it is being used, but of course + // that means nothing. + // + // There aren't many places that invoke setOwner at all (in Sam and Max). + // I did a quick search of the script dumps I have here; in those I found + // seven calls to setOwner, and only one with owner == 2. + + warning("Inside Sam and Max inventory hack! (obj %d)", obj); + for (int base = 6; base < 80; base++) { + int value = readArray(178, 0, base); + if (value == obj) + break; + if (value == 0) { + _scummVars[179]++; + writeArray(178, 0, base, obj); + break; + } + base++; + } + } + setOwnerOf(obj, owner); } |