*Proper arena_pending_points update, thanks ogeraisi
--HG-- branch : trunk
This commit is contained in:
@@ -1822,16 +1822,14 @@ void BattleGroundMgr::DistributeArenaPoints()
|
|||||||
//cycle that gives points to all players
|
//cycle that gives points to all players
|
||||||
for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr)
|
for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr)
|
||||||
{
|
{
|
||||||
|
//update database
|
||||||
|
CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
|
||||||
//add points to player
|
//add points to player
|
||||||
Player* pl = objmgr.GetPlayer(plr_itr->first);
|
Player* pl = objmgr.GetPlayer(plr_itr->first);
|
||||||
if (pl)
|
if (pl)
|
||||||
{
|
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
|
|
||||||
pl->ModifyArenaPoints(plr_itr->second);
|
pl->ModifyArenaPoints(plr_itr->second);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = 0 WHERE guid = '%u'", plr_itr->first);
|
|
||||||
CharacterDatabase._UpdateDataBlobValue(plr_itr->first, PLAYER_FIELD_ARENA_CURRENCY,
|
CharacterDatabase._UpdateDataBlobValue(plr_itr->first, PLAYER_FIELD_ARENA_CURRENCY,
|
||||||
std::min(int32(plr_itr->second),int32(sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))));
|
std::min(int32(plr_itr->second),int32(sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user