mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8193] Use constant instead explicit value in title index checks.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
3e2477945d
commit
4f53c4ee28
4 changed files with 5 additions and 3 deletions
|
|
@ -1426,7 +1426,7 @@ void WorldSession::HandleSetTitleOpcode( WorldPacket & recv_data )
|
||||||
recv_data >> title;
|
recv_data >> title;
|
||||||
|
|
||||||
// -1 at none
|
// -1 at none
|
||||||
if(title > 0 && title < 192)
|
if(title > 0 && title < MAX_TITLE_INDEX)
|
||||||
{
|
{
|
||||||
if(!GetPlayer()->HasTitle(title))
|
if(!GetPlayer()->HasTitle(title))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -19504,7 +19504,7 @@ bool Player::isTotalImmune()
|
||||||
|
|
||||||
bool Player::HasTitle(uint32 bitIndex)
|
bool Player::HasTitle(uint32 bitIndex)
|
||||||
{
|
{
|
||||||
if (bitIndex > 192)
|
if (bitIndex > MAX_TITLE_INDEX)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 fieldIndexOffset = bitIndex / 32;
|
uint32 fieldIndexOffset = bitIndex / 32;
|
||||||
|
|
|
||||||
|
|
@ -473,6 +473,8 @@ enum PlayerFlags
|
||||||
#define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39
|
#define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39
|
||||||
#define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40
|
#define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40
|
||||||
|
|
||||||
|
#define MAX_TITLE_INDEX (3*64) // 3 uint64 fields
|
||||||
|
|
||||||
// used in PLAYER_FIELD_BYTES values
|
// used in PLAYER_FIELD_BYTES values
|
||||||
enum PlayerFieldByteFlags
|
enum PlayerFieldByteFlags
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8192"
|
#define REVISION_NR "8193"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue