Fixed tag targeted effects on overridden attributes applying multiple times

Closes #358
This commit is contained in:
ThaumRystra
2024-11-09 15:24:56 +02:00
parent 5c80975bc1
commit 7c648f67a3
3 changed files with 93 additions and 1 deletions

View File

@@ -156,7 +156,10 @@ function linkEffects(dependencyGraph, prop, computation) {
) {
// If the field wasn't specified and we're targeting an attribute or
// skill, just treat it like a normal effect on its variable name
dependencyGraph.addLink(targetProp.variableName, prop._id, 'effect');
// But ensure only a single link is created
if (!dependencyGraph.hasLink(targetProp.variableName, prop._id)) {
dependencyGraph.addLink(targetProp.variableName, prop._id, 'effect');
}
} else {
// Otherwise target a field on that property
const key = prop.targetField || getDefaultCalculationField(targetProp);