diff options
author | megamage <none@none> | 2009-07-23 09:34:42 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-23 09:34:42 +0800 |
commit | 4a0d187cd68e871be45fe662fbcb95ccebe68cce (patch) | |
tree | 05acbda04612a4224ce4f749432b3a3451443aa3 /src | |
parent | 2126ec3395cd7dd60d7d90bfa88b03fb99a04f29 (diff) |
[8193] Use constant instead explicit value in title index checks. Author: XTZGZoReX
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/MiscHandler.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index aeec27ced32..2488e7696e0 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -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; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3f799b90352..729899ec69d 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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; diff --git a/src/game/Player.h b/src/game/Player.h index 51f17027fa7..d834ceaee15 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -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 { |