mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-08-01 18:29:24 -04:00
Left-click targeting, the right-click world picker and the hover cursor each carried their own copy of the same traversal — build a hit sphere per entity, ray-test it, rank units against objects by distance to the entity centre, prefer a hostile. Around ninety lines apiece, agreeing on everything that matters and requiring lockstep edits to stay that way. The corpse fix before this had to be applied twice for exactly that reason, and the hover copy was already out of step: it had no critter case, so the cursor promised a click on something a click would miss. pickScene does the traversal once and returns what it found; each caller applies its own rules to the result. What genuinely differs is now stated as parameters — the right-click picker's taller, tighter fallback sphere and its chair skip — and what only one caller collects (a hooked bobber, quest objective objects) comes through a per-hit callback rather than a third copy of the loop. Net 265 lines out of game_screen.cpp. The two fixed-radius bobber tests stay where they are: those aim at one known GUID rather than searching the scene.