[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.166.2.2,1.166.2.3 script_v6.cpp,1.293.2.5,1.293.2.6
Travis Howell
kirben at users.sourceforge.net
Tue Mar 2 04:40:07 CET 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10429/scumm
Modified Files:
Tag: branch-0-6-0
object.cpp script_v6.cpp
Log Message:
Add recent Sam & Max inventory changes.
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.166.2.2
retrieving revision 1.166.2.3
diff -u -d -r1.166.2.2 -r1.166.2.3
--- object.cpp 20 Feb 2004 06:35:01 -0000 1.166.2.2
+++ object.cpp 2 Mar 2004 12:19:33 -0000 1.166.2.3
@@ -1191,19 +1191,27 @@
void ScummEngine::setOwnerOf(int obj, int owner) {
ScriptSlot *ss;
+
+ // In Sam & Max this is necessary, or you won't get your stuff back
+ // from the Lost and Found tent after riding the Cone of Tragedy. But
+ // it probably applies to all V6+ games. See bugs #493153 and #907113.
+ // FT disassembly is checked, behaviour is correct. [sev]
+
+ int arg = (_version >= 6) ? obj : 0;
+
if (owner == 0) {
clearOwnerOf(obj);
ss = &vm.slot[_currentScript];
if (ss->where == WIO_INVENTORY && _inventory[ss->number] == obj) {
putOwner(obj, 0);
- runInventoryScript(0);
+ runInventoryScript(arg);
stopObjectCode();
return;
}
}
putOwner(obj, owner);
- runInventoryScript(0);
+ runInventoryScript(arg);
}
int ScummEngine::getObjX(int obj) {
Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.293.2.5
retrieving revision 1.293.2.6
diff -u -d -r1.293.2.5 -r1.293.2.6
--- script_v6.cpp 29 Feb 2004 13:45:49 -0000 1.293.2.5
+++ script_v6.cpp 2 Mar 2004 12:19:33 -0000 1.293.2.6
@@ -1025,36 +1025,6 @@
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);
}
More information about the Scummvm-git-logs
mailing list