From fa1f58e5866239191891fd71feaa2b3cf7fca980 Mon Sep 17 00:00:00 2001 From: thebigMuh <81810641+thebigMuh@users.noreply.github.com> Date: Wed, 21 Apr 2021 19:11:12 +0200 Subject: [PATCH] Fixing OOB error when drawing partially filled XP bar pixels. (#1636) --- Source/qol/xpbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/qol/xpbar.cpp b/Source/qol/xpbar.cpp index f1a9be719..e931f59f6 100644 --- a/Source/qol/xpbar.cpp +++ b/Source/qol/xpbar.cpp @@ -91,7 +91,7 @@ void DrawXPBar(const CelOutputBuffer &out) Uint64 fullBar = BAR_WIDTH * prevXpDelta_1 / prevXpDelta; // Figure out how much to fill the last pixel of the XP bar, to make it gradually appear with gained XP - Uint64 onePx = prevXpDelta / BAR_WIDTH; + Uint64 onePx = prevXpDelta / BAR_WIDTH + 1; Uint64 lastFullPx = fullBar * prevXpDelta / BAR_WIDTH; const Uint64 fade = (prevXpDelta_1 - lastFullPx) * (SILVER_GRADIENT.size() - 1) / onePx;