[airstrike] Airstrike levels and goal oriented game-play

Erik Auerswald auerswal at unix-ag.uni-kl.de
Wed Aug 2 09:48:57 EDT 2006


Hi,

On Wed, Aug 02, 2006 at 10:52:18AM +0200, Erik Auerswald wrote:
> On Tue, Aug 01, 2006 at 08:36:37PM +0300, Eero Tamminen wrote:
> > Btw. At the level start, the level goal should be also displayed
> > even if it's just "find how to end the level".
> 
> Yes, this needs to be done. Maybe the next thing to implement are
> multiline messages?

The attached patch allows to use \n to include newlines in strings
enclosed in double quotes read by the airstrike shell. The change is
inside the chop_str() function.

Example:
"msg=This is on line 1.\nAnd this on line 2."

Since display_text() already knows how to handle strings with newlines
this enables us to show multiline messages from e.g. triggers.

If no one objects I'll commit this to svn soon.

Erik
-------------- next part --------------
Index: src/support/shell.c
===================================================================
--- src/support/shell.c	(revision 95)
+++ src/support/shell.c	(working copy)
@@ -51,7 +51,17 @@
 	      src++;
 	      argv[argc++] = dst;
 	      while (*src && *src != '"')
-		*dst++ = *src++;
+	        {
+		  if ((*src == '\\') && (*(src+1) == 'n'))
+		    {
+		      *dst++ = '\n';
+		      src += 2;
+		    }
+		  else
+		    {
+		      *dst++ = *src++;
+		    }
+		}
 	      if (*src)
 		src++;
 	      else


More information about the airstrike mailing list