mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
[8193] Use constant instead explicit value in title index checks. Author: XTZGZoReX
--HG-- branch : trunk
This commit is contained in:
@@ -1493,7 +1493,7 @@ void WorldSession::HandleSetTitleOpcode( WorldPacket & recv_data )
|
||||
recv_data >> title;
|
||||
|
||||
// -1 at none
|
||||
if(title > 0 && title < 192)
|
||||
if(title > 0 && title < MAX_TITLE_INDEX)
|
||||
{
|
||||
if(!GetPlayer()->HasTitle(title))
|
||||
return;
|
||||
|
||||
@@ -20356,7 +20356,7 @@ bool Player::isTotalImmune()
|
||||
|
||||
bool Player::HasTitle(uint32 bitIndex)
|
||||
{
|
||||
if (bitIndex > 192)
|
||||
if (bitIndex > MAX_TITLE_INDEX)
|
||||
return false;
|
||||
|
||||
uint32 fieldIndexOffset = bitIndex / 32;
|
||||
|
||||
@@ -476,6 +476,8 @@ enum PlayerFlags
|
||||
#define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39
|
||||
#define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40
|
||||
|
||||
#define MAX_TITLE_INDEX (3*64) // 3 uint64 fields
|
||||
|
||||
// used in PLAYER_FIELD_BYTES values
|
||||
enum PlayerFieldByteFlags
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user