diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Battlegrounds/BattlegroundMgr.cpp | 12 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index f6a3148edc3..8accb93f0f0 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -376,7 +376,9 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) } } - data->WriteBits(bg->GetPlayerScoresSize(), 21); + size_t count_pos = data->bitwpos(); + data->WriteBits(0, 21); + uint32 count = 0; for (Battleground::BattlegroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr) { if (!bg->IsPlayerInBattleground(itr->first)) @@ -386,6 +388,12 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) } Player* player = ObjectAccessor::FindPlayer(itr->first); + if (!player) + { + TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in world!", itr->first, bg->GetTypeID(true)); + continue; + } + ObjectGuid playerGUID = itr->first; BattlegroundScore* score = itr->second; @@ -539,8 +547,10 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) // if (unk 4) << uint32() unk buff.WriteByteSeq(playerGUID[7]); buff.WriteByteSeq(playerGUID[2]); + ++count; } + data->PutBits(count_pos, count, 21); data->WriteBit(bg->GetStatus() == STATUS_WAIT_LEAVE); // If Ended if (isRated) // arena diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b74ed66a953..0efe252f597 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -452,7 +452,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const float preciseBasePoints = ScalingMultiplier * multiplier; if (DeltaScalingMultiplier) { - float delta = DeltaScalingMultiplier * ScalingMultiplier * multiplier * 0.5f; + float delta = fabs(DeltaScalingMultiplier * ScalingMultiplier * multiplier * 0.5f); preciseBasePoints += frand(-delta, delta); } |