summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/levcomp.ypp
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-09-05 18:09:29 -0400
committerNeil Moore <neil@s-z.org>2013-09-05 19:08:19 -0400
commitf94d332ad4a3ed19015f73155400ed316d1044b5 (patch)
tree0ef036f06eff665e697349c491b85ed8689dd0d4 /crawl-ref/source/util/levcomp.ypp
parent2e0ee8d010926510cd55647d40ee58d93cb863fb (diff)
downloadcrawl-ref-f94d332ad4a3ed19015f73155400ed316d1044b5.tar.gz
crawl-ref-f94d332ad4a3ed19015f73155400ed316d1044b5.zip
Add a new "ORDER:" map header for sorting game-mode maps.
The first step towards fixing #7383. Defaults to INT_MAX, so things that do not set it explicitly will be last. If two maps have the same ORDER:, they will be sorted by description/name as before. Also change the des cache index format to store ORDER (necessitating a minor version bump). Rather than leaving ORDER at its default value when loading an des cache index from earlier versions, we throw out the entire index so that it can be regenerated.
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r--crawl-ref/source/util/levcomp.ypp11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index dc6389b9c0..ba36a809da 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -45,7 +45,7 @@ static NORETURN void yyerror(const char *e)
%token <i> NAME DEPTH ORIENT PLACE CHANCE WEIGHT MONS ITEM MARKER COLOUR
%token <i> PRELUDE MAIN VALIDATE VETO EPILOGUE NSUBST WELCOME LFLAGS BFLAGS
%token <i> LFLOORCOL LROCKCOL LFLOORTILE LROCKTILE FTILE RTILE TILE
-%token <i> SUBVAULT FHEIGHT DESC
+%token <i> SUBVAULT FHEIGHT DESC ORDER
%token <i> COMMA COLON PERC DASH CHARACTER
%token <f> NUMBER
@@ -143,6 +143,7 @@ name : NAME STRING
metaline : place
| desc
+ | order
| depth
| chance
| weight
@@ -584,6 +585,14 @@ desc : DESC STRING
}
;
+order : ORDER NUMBER
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("order(%d)", int($2)));
+ }
+ ;
+
depth : DEPTH {}
| DEPTH STRING
{