[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.122,1.123 object.cpp,1.125,1.126
Max Horn
fingolfin at users.sourceforge.net
Fri Jun 20 03:58:50 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv29753
Modified Files:
script_v5.cpp object.cpp
Log Message:
fixed Zak256 (and possibly other V3 games); Not quite sure if the behaviour is correct for V4 games, that needs testing
Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- script_v5.cpp 19 Jun 2003 18:08:39 -0000 1.122
+++ script_v5.cpp 20 Jun 2003 10:53:06 -0000 1.123
@@ -1897,7 +1897,7 @@
work[i++] = fetchScriptByte();
}
}
- work[i] = 0;
+ work[i++] = 0;
if (obj < _numActors)
error("Can't set actor %d name with new-name-of", obj);
@@ -1921,7 +1921,10 @@
if (_features & GF_OLD_BUNDLE)
offset = *(objptr + 16);
+ else if (_version == 3)
+ offset = *(objptr + 18);
else
+ // FIXME: is this really correct?
offset = READ_LE_UINT16(objptr + 18);
size = READ_LE_UINT16(objptr) - offset;
@@ -1978,12 +1981,13 @@
return; // Silently bail out
- if (i >= size) {
- warning("New name of object %d too long (old *%s* new *%s*)", obj, name, work);
- i = size - 1;
+ if (i > size) {
+ warning("New name of object %d too long: old 's' (%d), new '%s' (%d))",
+ obj, name, i, work, size);
+ i = size;
}
- memcpy(name, work, i+1);
+ memcpy(name, work, i);
runInventoryScript(0);
}
Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- object.cpp 19 Jun 2003 18:08:39 -0000 1.125
+++ object.cpp 20 Jun 2003 10:53:06 -0000 1.126
@@ -932,7 +932,10 @@
offset = *(objptr + 14);
else if (_features & GF_OLD_BUNDLE)
offset = *(objptr + 16);
+ else if (_version == 3)
+ offset = *(objptr + 18);
else
+ // FIXME: is this really correct?
offset = READ_LE_UINT16(objptr + 18);
return (objptr + offset);
More information about the Scummvm-git-logs
mailing list