Browse Source

Fixing OOB error when drawing partially filled XP bar pixels. (#1636)

pull/1638/head
thebigMuh 5 years ago committed by GitHub
parent
commit
fa1f58e586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Source/qol/xpbar.cpp

2
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;

Loading…
Cancel
Save