mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
Fix Exalted reputation tier not displaying correctly (off-by-one in getTier loop)
This commit is contained in:
parent
a207ceef6c
commit
c9ea61aba7
1 changed files with 2 additions and 1 deletions
|
|
@ -1220,8 +1220,9 @@ void InventoryScreen::renderReputationPanel(game::GameHandler& gameHandler) {
|
||||||
{ "Exalted", 42000, 42000, ImVec4(1.0f, 0.84f, 0.0f, 1.0f) },
|
{ "Exalted", 42000, 42000, ImVec4(1.0f, 0.84f, 0.0f, 1.0f) },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr int kNumTiers = static_cast<int>(sizeof(tiers) / sizeof(tiers[0]));
|
||||||
auto getTier = [&](int32_t val) -> const RepTier& {
|
auto getTier = [&](int32_t val) -> const RepTier& {
|
||||||
for (int i = 6; i >= 0; --i) {
|
for (int i = kNumTiers - 1; i >= 0; --i) {
|
||||||
if (val >= tiers[i].floor) return tiers[i];
|
if (val >= tiers[i].floor) return tiers[i];
|
||||||
}
|
}
|
||||||
return tiers[0];
|
return tiers[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue