[Scummvm-cvs-logs] SF.net SVN: scummvm:[47629] tools/trunk/engines/mohawk/archive.cpp

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Thu Jan 28 08:27:24 CET 2010


Revision: 47629
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47629&view=rev
Author:   tdhs
Date:     2010-01-28 07:27:23 +0000 (Thu, 28 Jan 2010)

Log Message:
-----------
Fix for a minor bug in Mohawk archive class which caused extract_mohawk to associate a name with the wrong resource.

Modified Paths:
--------------
    tools/trunk/engines/mohawk/archive.cpp

Modified: tools/trunk/engines/mohawk/archive.cpp
===================================================================
--- tools/trunk/engines/mohawk/archive.cpp	2010-01-28 05:20:52 UTC (rev 47628)
+++ tools/trunk/engines/mohawk/archive.cpp	2010-01-28 07:27:23 UTC (rev 47629)
@@ -227,8 +227,12 @@
 	output.id = id;
 	output.index = fileTableIndex;
 	output.flags = _fileTable[fileTableIndex].flags;
-	if (idIndex < _types[typeIndex].nameTable.num)
-		output.name = _types[typeIndex].nameTable.entries[idIndex].name;
+	for (uint16 i = 0; i < _types[typeIndex].nameTable.num; i++) {
+		if (_types[typeIndex].nameTable.entries[i].index == fileTableIndex+1) {
+			output.name = _types[typeIndex].nameTable.entries[i].name;
+			break;
+		}
+	}
 
 	return output;
 }
@@ -262,8 +266,12 @@
 	output.index = fileTableIndex;
 	output.flags = _fileTable[fileTableIndex].flags;
 
-	if (_curExTypeIndex < _types[_curExType].nameTable.num)
-		output.name = _types[_curExType].nameTable.entries[_curExTypeIndex].name;
+	for (uint16 i = 0; i < _types[_curExType].nameTable.num; i++) {
+		if (_types[_curExType].nameTable.entries[i].index == fileTableIndex+1) {
+			output.name = _types[_curExType].nameTable.entries[i].name;
+			break;
+		}
+	}
 
 	_curExTypeIndex++;
 	return output;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list