From 625ea2a6dbcf3672536495586f3a40b6ec012d4f Mon Sep 17 00:00:00 2001 From: H0zen Date: Wed, 17 Feb 2016 15:46:42 +0200 Subject: [PATCH] Various external fixes - part 1 - ported fixes from cmangos repositories --- src/game/WorldHandlers/MiscHandler.cpp | 19 +++++++++++-------- src/game/WorldHandlers/SpellEffects.cpp | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/game/WorldHandlers/MiscHandler.cpp b/src/game/WorldHandlers/MiscHandler.cpp index 260f9a23..7aae194e 100644 --- a/src/game/WorldHandlers/MiscHandler.cpp +++ b/src/game/WorldHandlers/MiscHandler.cpp @@ -993,15 +993,18 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) recv_data >> guid; DEBUG_LOG("Inspected guid is %s", guid.GetString().c_str()); - _player->SetSelectionGuid(guid); - Player* plr = sObjectMgr.GetPlayer(guid); - if (!plr) // wrong player - { return; } + if (plr && _player->IsFriendlyTo(plr) && _player->IsWithinDistInMap(plr, TRADE_DISTANCE, false)) // why not 3D check? + { + _player->SetSelectionGuid(guid); + + WorldPacket data(SMSG_INSPECT, 8); + data << ObjectGuid(guid); + SendPacket(&data); + } + else + { DEBUG_LOG("%s not found!", guid.GetString().c_str()); } - WorldPacket data(SMSG_INSPECT, 8); - data << ObjectGuid(guid); - SendPacket(&data); } void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) @@ -1010,7 +1013,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) recv_data >> guid; Player* pl = sObjectMgr.GetPlayer(guid); - if (pl) + if (pl && _player->IsFriendlyTo(pl) && _player->IsWithinDistInMap(pl, TRADE_DISTANCE, false)) { WorldPacket data(MSG_INSPECT_HONOR_STATS, (8 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1)); data << guid; // player guid diff --git a/src/game/WorldHandlers/SpellEffects.cpp b/src/game/WorldHandlers/SpellEffects.cpp index 2f2ba5c2..77708af1 100644 --- a/src/game/WorldHandlers/SpellEffects.cpp +++ b/src/game/WorldHandlers/SpellEffects.cpp @@ -3022,7 +3022,7 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx) NewSummon->SetRespawnCoord(pos); - uint32 petlevel = m_caster->getLevel(); + uint32 petlevel = std::max(m_caster->getLevel() + m_spellInfo->EffectMultipleValue[eff_idx], 1.0f); NewSummon->setPetType(SUMMON_PET); uint32 faction = m_caster->getFaction(); @@ -5192,7 +5192,7 @@ void Spell::EffectBind(SpellEffectIndex eff_idx) // zone update data.Initialize(SMSG_PLAYERBOUND, 8 + 4); - data << player->GetObjectGuid(); + data << m_caster->GetObjectGuid(); data << uint32(area_id); player->SendDirectMessage(&data); }