Core/Player: Fix MAX_TITLE_INDEX calculation for title mask (#461)
* Core/Player: Fix MAX_TITLE_INDEX calculation for title mask * Core/Player: Replace sizeof-based bit calculation with explicit 64
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -24916,7 +24916,9 @@ bool Player::isTotalImmune() const
|
||||
|
||||
bool Player::HasTitle(uint32 bitIndex) const
|
||||
{
|
||||
if (bitIndex > MAX_TITLE_INDEX)
|
||||
// bitIndex is zero-based inside PLAYER__FIELD_KNOWN_TITLES.
|
||||
// MAX_TITLE_INDEX is the total number of available bits (valid range: [0, MAX_TITLE_INDEX)).
|
||||
if (bitIndex >= MAX_TITLE_INDEX)
|
||||
return false;
|
||||
|
||||
uint32 fieldIndexOffset = bitIndex / 32;
|
||||
|
||||
Reference in new issue
Block a user