Merge pull request #83 from H0zen/develop21

Various external fixes - part 1
This commit is contained in:
MadMax 2016-02-17 14:33:09 +00:00
commit 50e913d252
2 changed files with 13 additions and 10 deletions

View File

@ -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

View File

@ -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);
}