PathOfBuildingCommunity / PathOfBuildingCommunity/PathOfBuilding

Refactor `pathDist` variable to always be numerical

Open
#2,396 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

technical
Dominant language
Lua
Stars
5.4k
Forks
2.4k
Avg merge
1d 12h
Merged PRs (30d)
26

Description

The pathDist attribute is a bit of a mess. It can either assume the normal distance if there is a path, or some magic values (100, 1000, "Anoint", "Cluster"), depending on the circumstances. I'd recommend refactoring "Anoint" and "Cluster" to yet another two magic numbers to avoid having to check for the type of the attribute and to decouple computation with and presentation of these magic numbers, as well as documenting them. However, that's out of scope for this PR.

Originally posted by @ppoelzl in https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/2250#r606424703

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the pathDist discussion in pull request #2250 and locate every use of the pathDist attribute. The refactor is complete when pathDist is always numerical and presentation no longer depends on checking for string values such as "Anoint" or "Cluster".

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
game-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.