[Scummvm-cvs-logs] SF.net SVN: scummvm:[54879] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Dec 12 08:17:13 CET 2010


Revision: 54879
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54879&view=rev
Author:   peres001
Date:     2010-12-12 07:17:13 +0000 (Sun, 12 Dec 2010)

Log Message:
-----------
PARALLACTION: parse command lists for kNoneType zones, even if defined after TYPE markers. This fixes bug #3131769.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parser.h
    scummvm/trunk/engines/parallaction/parser_ns.cpp

Modified: scummvm/trunk/engines/parallaction/parser.h
===================================================================
--- scummvm/trunk/engines/parallaction/parser.h	2010-12-12 01:31:06 UTC (rev 54878)
+++ scummvm/trunk/engines/parallaction/parser.h	2010-12-12 07:17:13 UTC (rev 54879)
@@ -179,6 +179,7 @@
 	virtual void parseMergeData(ZonePtr z);
 	virtual void parseHearData(ZonePtr z);
 	virtual void parseSpeakData(ZonePtr z);
+	virtual void parseNoneData(ZonePtr z);
 protected:
 	Common::String	parseComment();
 	Common::String	parseDialogueString();

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2010-12-12 01:31:06 UTC (rev 54878)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2010-12-12 07:17:13 UTC (rev 54879)
@@ -1412,6 +1412,24 @@
 	}
 }
 
+void LocationParser_ns::parseNoneData(ZonePtr z) {
+	// "None" zones should have no content, but some 
+	// inconsistently define their command list after 
+	// the TYPE marker. This routine catches these 
+	// command lists that would be lost otherwise.
+	if (!scumm_stricmp(_tokens[0], "commands")) {
+		parseCommands(z->_commands);
+		ctxt.endcommands = false;
+		do {
+			_script->readLineToken(true);
+			_parser->parseStatement();
+		} while (!ctxt.endcommands);
+		
+		// no need to parse one more line here, as
+		// it is done by the caller
+	}
+}
+
 typedef void (LocationParser_ns::*ZoneTypeParser)(ZonePtr);
 static ZoneTypeParser parsers[] = {
 	0,	// no type
@@ -1423,7 +1441,7 @@
 	&LocationParser_ns::parseHearData,
 	0,	// feel
 	&LocationParser_ns::parseSpeakData,
-	0,	// none
+	&LocationParser_ns::parseNoneData,
 	0,	// trap
 	0,	// you
 	0	// command


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