[Scummvm-cvs-logs] SF.net SVN: scummvm:[55538] scummvm/trunk/engines/mohawk/livingbooks.cpp

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Tue Jan 25 18:35:53 CET 2011


Revision: 55538
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55538&view=rev
Author:   fuzzie
Date:     2011-01-25 17:35:53 +0000 (Tue, 25 Jan 2011)

Log Message:
-----------
MOHAWK: Read kLBEventNotified data after commands.

This fixes some pages in Maggie's Farmyard Adventure, at least.
Thanks to clone2727 for testing this.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/livingbooks.cpp

Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp	2011-01-25 15:14:07 UTC (rev 55537)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp	2011-01-25 17:35:53 UTC (rev 55538)
@@ -1779,15 +1779,6 @@
 			entry->newUnknown, entry->newMode, entry->newPage, entry->newSubpage);
 		size -= 8;
 	}
-	if (entry->event == kLBEventNotified) {
-		if (size < 4)
-			error("not enough bytes (%d) in kLBEventNotified, opcode 0x%04x", size, entry->opcode);
-		entry->matchFrom = stream->readUint16();
-		entry->matchNotify = stream->readUint16();
-		debug(4, "kLBEventNotified: unknowns %04x, %04x",
-			entry->matchFrom, entry->matchNotify);
-		size -= 4;
-	}
 	if (entry->opcode == kLBOpSendExpression) {
 		if (size < 4)
 			error("not enough bytes (%d) in kLBOpSendExpression, event 0x%04x", size, entry->event);
@@ -1814,7 +1805,7 @@
 		if (msgId != kLBCommand)
 			error("expected a command in script entry, got 0x%04x", msgId);
 
-		if (msgLen != size && !conditionTag)
+		if (msgLen != size - (entry->event == kLBEventNotified ? 4 : 0) && !conditionTag)
 			error("script entry msgLen %d is not equal to size %d", msgLen, size);
 
 		Common::String command = _vm->readString(stream);
@@ -1827,6 +1818,15 @@
 		entry->command = command;
 		debug(4, "script entry command '%s'", command.c_str());
 	}
+	if (entry->event == kLBEventNotified) {
+		if (size < 4)
+			error("not enough bytes (%d) in kLBEventNotified, opcode 0x%04x", size, entry->opcode);
+		entry->matchFrom = stream->readUint16();
+		entry->matchNotify = stream->readUint16();
+		debug(4, "kLBEventNotified: unknowns %04x, %04x",
+			entry->matchFrom, entry->matchNotify);
+		size -= 4;
+	}
 
 	if (isSubentry) {
 		// TODO: subentries may be aligned, so this check is a bit too relaxed


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