ungaminga / tmp (http://tmp.com/)

tmp

Clone this repository (size: 83.3 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/ungaminga/tmp/
commit 6849: 44f4709290ad
parent 6848: 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
Machiavelli
3 months ago

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
            *data << uint8(plr->GetBGTeam());               // BG Team ID (Green/Gold team, not faction teams in arena)
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
        {