Remove exit path when only one assort is found for a quest, this isnt always the correct one, force the weights to be appied to each finding
If result is <0, ignore
This commit is contained in:
parent
309b882796
commit
167bba85e2
@ -235,7 +235,17 @@ namespace AssortGenerator
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var highestScoringAssortIdMatch = results.OrderByDescending(x => x.Value).First().Key;
|
if (results.Values.All( x => x < 0))
|
||||||
|
{
|
||||||
|
LoggingHelpers.LogError($"{trader} item templateId: {assortUnlock.ItemUnlockedTemplateId} ({ItemName}). questId: {assortUnlock.QuestId}. Only negative scored matches found");
|
||||||
|
|
||||||
|
result.success.Add($"UnknownAssortId{unknownCount}", assortUnlock.QuestId);
|
||||||
|
unknownCount++;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var highestScoringAssortIdMatch = results.OrderByDescending(x => x.Value).Where(x => x.Value > 0).First().Key;
|
||||||
|
|
||||||
// Add assort item id to blacklist so it wont be matched again
|
// Add assort item id to blacklist so it wont be matched again
|
||||||
assortItemsThatMatchBlackList.Add(highestScoringAssortIdMatch);
|
assortItemsThatMatchBlackList.Add(highestScoringAssortIdMatch);
|
||||||
@ -315,13 +325,6 @@ namespace AssortGenerator
|
|||||||
LoggingHelpers.LogWarning($"{trader} item templateId: {assortUnlock.ItemUnlockedTemplateId}. questId: {questData.Value.QuestName}. multiple matches found. ");
|
LoggingHelpers.LogWarning($"{trader} item templateId: {assortUnlock.ItemUnlockedTemplateId}. questId: {questData.Value.QuestName}. multiple matches found. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only one result, no need to work out score
|
|
||||||
if (assortItemsThatMatch.Count == 1)
|
|
||||||
{
|
|
||||||
matchScores[assortItemsThatMatch[0]._id] = 1;
|
|
||||||
return matchScores;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var assortItemMatch in assortItemsThatMatch)
|
foreach (var assortItemMatch in assortItemsThatMatch)
|
||||||
{
|
{
|
||||||
matchScores[assortItemMatch._id] = 0;
|
matchScores[assortItemMatch._id] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user