[Scummvm-cvs-logs] CVS: residual walkplane.cpp,1.2,1.3 scene.cpp,1.9,1.10

James Brown ender at users.sourceforge.net
Wed Aug 20 02:14:02 CEST 2003


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1:/tmp/cvs-serv12700

Modified Files:
	walkplane.cpp scene.cpp 
Log Message:
Fix garage set loading


Index: walkplane.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/walkplane.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- walkplane.cpp	20 Aug 2003 00:35:37 -0000	1.2
+++ walkplane.cpp	20 Aug 2003 07:44:54 -0000	1.3
@@ -22,7 +22,15 @@
 void Sector::load(TextSplitter &ts) {
   char buf[256];
   int id = 0;
-  ts.scanString(" sector %256s", 1, buf);
+
+  // Sector NAMES can be null, but ts isn't flexible enough
+  if (strlen(ts.currentLine()) > strlen(" sector"))
+   ts.scanString(" sector %256s", 1, buf);
+  else {
+   ts.nextLine();
+   strcpy(buf, "");
+  }
+
   ts.scanString(" id %d", 1, &id);
   load0(ts, buf, id);
 }

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/scene.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- scene.cpp	19 Aug 2003 07:20:03 -0000	1.9
+++ scene.cpp	20 Aug 2003 07:44:54 -0000	1.10
@@ -65,7 +65,15 @@
   ts.expectString("section: sectors");
   if (ts.eof()) 	// Sectors are optional, but section: doesn't seem to be
 	return;
-  ts.scanString(" sector %256s", 1, tempBuf);
+
+ // Sector NAMES can be null, but ts doesn't seem flexible enough to allow this
+ if (strlen(ts.currentLine()) > strlen(" sector"))
+   ts.scanString(" sector %256s", 1, tempBuf);
+  else {
+   ts.nextLine();
+   strcpy(tempBuf, "");
+  }
+
   ts.scanString(" id %d", 1, &numSectors_);
   sectors_ = new Sector[numSectors_];
   // FIXME: This would be nicer if we could rewind the textsplitter





More information about the Scummvm-git-logs mailing list