Commit e04c7c87 authored by twanvl's avatar twanvl

keywords from the set file take precedence over keywords from the game file

parent 5355bef2
...@@ -483,10 +483,15 @@ String KeywordDatabase::expand(const String& text, ...@@ -483,10 +483,15 @@ String KeywordDatabase::expand(const String& text,
next.resize(0); next.resize(0);
closure(current); closure(current);
// are we done? // are we done?
for (int set_or_game = 0 ; set_or_game <= 1 ; ++set_or_game) {
FOR_EACH(n, current) { FOR_EACH(n, current) {
FOR_EACH(f, n->finished) { FOR_EACH(kw, n->finished) {
const Keyword* kw = f; if (kw->fixed != (bool)set_or_game) {
if (used.insert(kw).second) { 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 // we have found a possible match, for a keyword which we have not seen before
if (tryExpand(*kw, i, tagged, untagged, result, expand_type, if (tryExpand(*kw, i, tagged, untagged, result, expand_type,
match_condition, expand_default, combine_script, ctx, match_condition, expand_default, combine_script, ctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment