This patch allows the digits 0-9 to be used to indicate line numbers
in the MAP...ENDMAP arrays of level files. This makes it a wee
bit easier to place features. The digits get stripped out before
the map is interpreted.
map_cnt = 0;
return MAP_ID;
}
-<MAPC>[-|}{+ABCISHKPLWTF\\#. ]*\n {
+<MAPC>[-|}{+ABCISHKPLWTF\\#. 0123456789]*\n {
line_number++;
(void) strncpy(map + map_cnt, yytext, yyleng);
map_cnt += yyleng;
int max_hig = 0;
char msg[256];
- /* First : find the max width of the map */
+ /* First, strip out digits 0-9 (line numbering) */
+ for (s1 = s2 = map; *s1; s1++)
+ if (*s1 < '0' || *s1 > '9')
+ *s2++ = *s1;
+ *s2 = '\0';
+ /* Second, find the max width of the map */
s1 = map;
while (s1 && *s1) {
s2 = index(s1, NEWLINE);
}
/* Then parse it now */
-
while (map && *map) {
tmpmap[max_hig] = (char *) alloc(max_len);
s1 = index(map, NEWLINE);