edrinn / dante
fork of trinitycore
MOVING TO GOOGLE CODE! =========================== Adds 3.3 support in addition to testing some major patches (adding Recruit-A-Friend support?). Issues can be submitted but also serve mostly as a TODO list.
| commit 6801: | 44f4709290ad |
| parent 6794: | 600433a380f0 |
| branch: | trunk |
Fix a crash in BattleGroundMgr::BuildPvpLogDataPacket caused by objmgr not finding player object by guid when showing scoreboard. In this case get bg team ID for player via character database. Closes #938
Changed (Δ580 bytes):
raw changeset »
src/game/BattleGroundMgr.cpp (15 lines added, 1 lines removed)
Up to file-list src/game/BattleGroundMgr.cpp:
| … | … | @@ -1336,8 +1336,22 @@ void BattleGroundMgr::BuildPvpLogDataPac |
1336 |
1336 |
*data << uint32(itr->second->KillingBlows); |
1337 |
1337 |
if (type) // if (bg->isArena()) |
1338 |
1338 |
{ |
1339 |
// BG Team ID (Green/Gold team, not faction teams in arena) |
|
1339 |
1340 |
Player *plr = objmgr.GetPlayer(itr->first); |
1340 |
|
|
1341 |
uint8 team = 0; |
|
1342 |
if (plr) |
|
1343 |
team = plr->GetBGTeam(); |
|
1344 |
else |
|
1345 |
{ |
|
1346 |
QueryResult *result = CharacterDatabase.PQuery("SELECT team FROM character_battleground_data WHERE guid = '%u'", GUID_LOPART(itr->first)); |
|
1347 |
if (result) |
|
1348 |
{ |
|
1349 |
team = (*result)[0].GetUInt8(); |
|
1350 |
delete result; |
|
1351 |
} |
|
1352 |
else |
|
1353 |
sLog.outError("Player GUID %u - unable to find correct BG Team ID for MSG_PVP_LOG_DATA (scoreboard). Defaulting to 0.", GUID_LOPART(itr->first)); |
|
1354 |
} |
|
1341 |
1355 |
} |
1342 |
1356 |
else // if (!bg->isArena()) |
1343 |
1357 |
{ |
