From eaf5e9bef2c23f8a720ff9aac197f10511785568 Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 11 Jan 2009 02:17:31 +0000 Subject: [PATCH] keywords from the set file take precedence over keywords from the game file git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1344 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/keyword.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/data/keyword.cpp b/src/data/keyword.cpp index 1dc898e3..95df0296 100644 --- a/src/data/keyword.cpp +++ b/src/data/keyword.cpp @@ -483,10 +483,15 @@ String KeywordDatabase::expand(const String& text, next.resize(0); closure(current); // are we done? - FOR_EACH(n, current) { - FOR_EACH(f, n->finished) { - const Keyword* kw = f; - if (used.insert(kw).second) { + for (int set_or_game = 0 ; set_or_game <= 1 ; ++set_or_game) { + FOR_EACH(n, current) { + FOR_EACH(kw, n->finished) { + if (kw->fixed != (bool)set_or_game) { + continue; // first try set keywords, try game keywords in the second round + } + if (!used.insert(kw).second) { + continue; // already seen this keyword + } // we have found a possible match, for a keyword which we have not seen before if (tryExpand(*kw, i, tagged, untagged, result, expand_type, match_condition, expand_default, combine_script, ctx,