[Scummvm-cvs-logs] CVS: scummvm resource.cpp,1.78,1.79 script_v1.cpp,1.99,1.100
James Brown
ender at users.sourceforge.net
Tue May 7 23:58:02 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv25802
Modified Files:
resource.cpp script_v1.cpp
Log Message:
Fix a mistake in the resource loader.
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- resource.cpp 5 May 2002 20:01:54 -0000 1.78
+++ resource.cpp 8 May 2002 06:57:27 -0000 1.79
@@ -470,7 +470,7 @@
uint32 fileOffs;
uint32 size, tag;
-// debug(1, "loadResource(%s,%d)", resTypeFromId(type),idx);
+ // debug(1, "loadResource(%s,%d)", resTypeFromId(type),idx);
if (type == rtCharset && (_features & GF_SMALL_HEADER)) {
loadCharset(idx);
@@ -478,9 +478,12 @@
}
roomNr = getResourceRoomNr(type, idx);
- if (roomNr == 0 || idx >= res.num[type]) {
- error("%s %d undefined", res.name[type], idx);
- }
+
+ if (idx >= res.num[type])
+ error("%s %d undefined %d %d", res.name[type], idx, res.num[type], roomNr);
+
+ if (roomNr == 0)
+ roomNr = _roomResource;
if (type == rtRoom) {
fileOffs = 0;
Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- script_v1.cpp 7 May 2002 23:19:17 -0000 1.99
+++ script_v1.cpp 8 May 2002 06:57:27 -0000 1.100
@@ -825,19 +825,17 @@
{
int act = getVarOrDirectWord(0x80);
int newClass;
-
+
while ((_opcode = fetchScriptByte()) != 0xFF) {
newClass = getVarOrDirectWord(0x80);
if (newClass == 0) {
_classData[act] = 0;
-
- if( _features & GF_SMALL_HEADER)
+ if((_features & GF_SMALL_HEADER) && act <= NUM_ACTORS)
{
Actor *a;
- a=derefActor(act);
+ a = derefActorSafe(act, "actorSetClass");
a->forceClip=0;
- }
-
+ }
continue;
}
More information about the Scummvm-git-logs
mailing list