improve matching of entries to objectives

If the faction does not match, we don't care about the other match criteria.
This commit is contained in:
Florian Stinglmayr 2021-11-20 11:27:56 +01:00
parent 2cf21f159d
commit 6d404a99e2

View File

@ -32,6 +32,19 @@ namespace EliteBGS.BGS {
}
}
if (e.Faction != null && faction != null) {
if (string.Compare(e.Faction, faction, true) != 0) {
/* if we have a faction, and it doesn't match we don't care.
* faction is the most important comparision, so if it doesn't match
* it is not the right objective
*/
return 0;
} else {
++match_count;
}
}
/* system and station only add to the match strength though */
if (e.System != null && system != null) {
if (string.Compare(e.System, system, true) == 0) {
++match_count;
@ -44,12 +57,6 @@ namespace EliteBGS.BGS {
}
}
if (e.Faction != null && faction != null) {
if (string.Compare(e.Faction, faction, true) == 0) {
++match_count;
}
}
return match_count;
}