Files
runelite/runelite-client
Macweese 65d2f45090 WorldLocation: Fields hierarchy
After some testing I found that a niche issue arises from the combination of the alphabetical sorting and the for loop. This aims to band-aid the issue as best possible until proper rework is done.

Renamed fields

Appended main areas (BB) which house other locations with `_ZONE` .

Example
Old → `HOSIDIUS("Hosidius", new Location(1737, 3627, 1789, 3582), 0),`
New → `HOSIDIUS_ZONE("Hosidius", new Location(1737, 3627, 1789, 3582), 0),`

Reason for this is to solve a problem with the `for loop` responsible for iterating over all locations to find which one the player is located in.
Since they are sorted alphabetically, `HOSIDIUS` comes before `HOSIDIUS_BANK` or any other location prefixed with "hosidius".
Disregarding if  `worldArea ∈ BB`.

So, coincidentally, appending BB areas with `_ZONE` is just a lucky "solution" as a result of the alphabetical sorting to push the area down in the hierarchy.

To be clear; This is a hack, not a proper solution.
Ideally, in a perfect world the entire thing would be replaced by a proper R-Tree or other spatial access method.
However, for now, this is as good as it gets seeing as it'd be a pretty big task.
2020-09-05 10:54:21 +02:00
..
2020-09-05 10:54:21 +02:00