alexsylex / CompassNavigationOverhaul

MIT License
11 stars 7 forks source link

Keep track of the `TESQuestTarget` for which each marker was created #25

Closed WaterFace closed 1 year ago

WaterFace commented 2 years ago

Currently, markers from quests with multiple objectives will usually display the wrong objective text. In reverse-engineering Skyrim's executable, I found that the rbx register contains a TESQuestTarget * in the same scope that the current code pulls out a TESQuest *. Through a slightly roundabout method, (TESQuestTarget is a very strange data type) we can deduce which BGSInstancedQuestObjectives should be associated with each marker, and thus can show the correct objective text on every marker, even markers pointing to teleport doors behind which lay multiple objectives. Note that it will still only display one quest's objectives at a time, due to the current implementation of HUDMarkerManager::SetMarkersExtraInfo().