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

Đang mở
#10,429 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 8 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
lua
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Lua
Star
5.5k
Fork
2.4k
Merge trung bình
6 ngày 14 giờ
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PathOfBuildingCommunity/PathOfBuilding

Tất cả issue của PathOfBuildingCommunity/PathOfBuilding

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.