aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-11-26 10:34:11 +0100
committerShauren <shauren.trinity@gmail.com>2012-11-26 10:34:11 +0100
commit5e9acb33413de381e9eff1b515acccab36a33282 (patch)
tree6591fd5d159d665a01a02718fa67fd7c852b7bec /src
parent2a4ba49664540e38ef3eee9873c7f4a4bc2b85cb (diff)
Core/Player: Fixed crashes happening when player logs in to a battleground which has ended and doesn't have valid return location stored in database.
Closes #5441 Closes #7093 Closes #8242
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 215902cb30f..85f12812014 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -16875,7 +16875,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
const WorldLocation& _loc = GetBattlegroundEntryPoint();
mapId = _loc.GetMapId(); instanceId = 0;
- if (mapId == MAPID_INVALID) // Battleground Entry Point not found (???)
+ // Db field type is type int16, so it can never be MAPID_INVALID
+ //if (mapId == MAPID_INVALID) -- code kept for reference
+ if (int16(mapId) == int16(-1)) // Battleground Entry Point not found (???)
{
sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid);
RelocateToHomebind();