aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authorw12x <none@none>2008-10-22 04:05:15 -0500
committerw12x <none@none>2008-10-22 04:05:15 -0500
commitbde02d68298e31eb972ada39e5730786d629d32a (patch)
tree24309a21138ae8e7822d5c1fae05332999270339 /src/game/Player.cpp
parent389a9e3cea196275e13f4eb66ef99fb631607631 (diff)
[svn] Added sanity checks in loading player cache to prevent crashing upon corrupted player data.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index c082e18a149..87ada7f8ab5 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13626,11 +13626,8 @@ float Player::GetFloatValueFromArray(Tokens const& data, uint16 index)
uint32 Player::GetUInt32ValueFromDB(uint16 index, uint64 guid)
{
- //rognar optimization
- //must be improved!! "if" and "switch" - it's very not aesthetically :)))
- //but we should know whith data is cached
- //PLAYER_FIELD_ARENA_TEAM_INFO* very is often using with pvp&arena patch :)
- if( index == PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 0 * 6 + 5
+ // todo: cleanup in this, move to a separate function.
+ if( index == PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 0 * 6 + 5
|| index == PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 * 6 + 5
|| index == PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 2 * 6 + 5
|| index == PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (0 * 6)