• R/O
  • SSH
  • HTTPS

jsporkhack: コミット


コミットメタ情報

リビジョン39 (tree)
日時2009-11-07 19:23:28
作者dplusplus

ログメッセージ

本家#479
Improve lev_comp error messages, and make sure the map area is set as the whole
level, if using the fill character with LEVEL.

変更サマリ

差分

--- JSporkHack/trunk/util/lev_comp.y (revision 38)
+++ JSporkHack/trunk/util/lev_comp.y (revision 39)
@@ -178,6 +178,8 @@
178178 | ',' filling
179179 {
180180 splev.init_lev.filling = (schar) $2;
181+ max_x_map = COLNO-1;
182+ max_y_map = ROWNO;
181183 }
182184 ;
183185
@@ -189,15 +191,15 @@
189191 {
190192 splev.init_lev.fg = what_map_char((char) $3);
191193 if (splev.init_lev.fg == INVALID_TYPE)
192- yyerror("Invalid foreground type.");
194+ yyerror("INIT_MAP: Invalid foreground type.");
193195 splev.init_lev.bg = what_map_char((char) $5);
194196 if (splev.init_lev.bg == INVALID_TYPE)
195- yyerror("Invalid background type.");
197+ yyerror("INIT_MAP: Invalid background type.");
196198 splev.init_lev.smoothed = $7;
197199 splev.init_lev.joined = $9;
198200 if (splev.init_lev.joined &&
199201 splev.init_lev.fg != CORR && splev.init_lev.fg != ROOM)
200- yyerror("Invalid foreground type for joined map.");
202+ yyerror("INIT_MAP: Invalid foreground type for joined map.");
201203 splev.init_lev.lit = $11;
202204 splev.init_lev.walled = $13;
203205 $$ = 1;
@@ -1344,7 +1346,7 @@
13441346 tmprandline->y2 = current_region.y2;
13451347 tmprandline->fg = what_map_char((char) $5);
13461348 if (tmprandline->fg == INVALID_TYPE) {
1347- yyerror("Invalid map character in randline!");
1349+ yyerror("RANDLINE: Invalid map character!");
13481350 }
13491351 tmprandline->lit = $7;
13501352 tmprandline->roughness = $9;
@@ -1370,12 +1372,12 @@
13701372 tmpspill->y = current_coord.y;
13711373 tmpspill->typ = what_map_char((char) $5);
13721374 if (tmpspill->typ == INVALID_TYPE) {
1373- yyerror("Invalid map character in spill!");
1375+ yyerror("SPILL: Invalid map character!");
13741376 }
13751377 tmpspill->direction = $7;
13761378 tmpspill->count = $9;
13771379 if (tmpspill->count < 1) {
1378- yyerror("Invalid count in spill!");
1380+ yyerror("SPILL: Invalid count!");
13791381 }
13801382 tmpspill->lit = $11;
13811383
@@ -1686,13 +1688,13 @@
16861688 /* This series of if statements is a hack for MSC 5.1. It seems that its
16871689 tiny little brain cannot compile if these are all one big if statement. */
16881690 if ($2 < 0 || $2 > (int)max_x_map)
1689- yyerror("Region out of map range!");
1691+ yyerror("Region out of map range (x1)!");
16901692 else if ($4 < 0 || $4 > (int)max_y_map)
1691- yyerror("Region out of map range!");
1693+ yyerror("Region out of map range (y1)!");
16921694 else if ($6 < 0 || $6 > (int)max_x_map)
1693- yyerror("Region out of map range!");
1695+ yyerror("Region out of map range (x2)!");
16941696 else if ($8 < 0 || $8 > (int)max_y_map)
1695- yyerror("Region out of map range!");
1697+ yyerror("Region out of map range (y2)!");
16961698 current_region.x1 = $2;
16971699 current_region.y1 = $4;
16981700 current_region.x2 = $6;
旧リポジトリブラウザで表示