Tree hover preview uses the stale Split Personality distance to class start

Offen
#10,429 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 8 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
lua
Bereich
backend

Rechercherichtung

Start with src/Modules/CalcSetup.lua around the jewel scaling and hover preview code, then read src/Classes/PassiveSpec.lua for how distanceToClassStart is built. Trace how override.addNodes and removeNodes affect env.allocNodes, and compare the preview with the result after allocation. Done when the preview uses the hypothetical path distance and matches the post-allocation Split Personality bonus.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

What happens

The passive tree hover preview ("allocating this node will give you...") for a node that changes a Split Personality socket's distance to the class start uses the current distance, not the distance after the allocation. The preview then disagrees with the result after clicking.

The easiest case to reproduce (derived from the code):

  1. Allocate a jewel socket some way from your class start and socket Split Personality in it. Note the jewel's bonus (e.g. "+N to Strength", scaled by 25% per passive between the socket and the class start).
  2. Deallocate only the socket node (keep the path to it), so the jewel stays assigned to the now-unallocated socket.
  3. Hover the socket node.

Expected: the preview shows the Split Personality bonus at the scaled value you get after allocating the socket.
Actual: the preview shows the jewel at its unscaled base value (distance 0). After clicking, the stats are higher than the preview said.

The same happens when you hover a node that gives an allocated Split Personality socket a shorter (or longer) allocated path to the class start: the preview uses the old distance.

Cause

The jewel scale is read from the node's cached distanceToClassStart:

distanceToClassStart is only written by PassiveSpec:BuildAllDependsAndPaths from the live allocation. It is reset to 0 for every socket and then set only for allocated sockets, walking only allocated nodes:

The hover preview runs CALCULATOR mode with override.addNodes/removeNodes (CalcSetup.lua#L726-L729). That changes env.allocNodes (so the jewel in the not-yet-allocated socket applies, #L860), but the distance is never worked out again for the hypothetical allocation.

Possible fix

When override.addNodes/removeNodes is present, work out the distance for sockets holding a jewelIncEffectFromClassStart jewel against env.allocNodes (same breadth-first search as SetNodeDistanceToClassStart), instead of reading the cached node field.

Vorherrschende Sprache
Lua
Sterne
5.5k
Forks
2.4k
Ø Merge
6 T. 14 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PathOfBuildingCommunity/PathOfBuilding

Alle Issues in PathOfBuildingCommunity/PathOfBuilding

Ähnliche Issues

Weitere Issues zu Lua

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.