From f6e8ccb239eaaa98bceab708a831e163d4107a3c Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 3 May 2009 10:45:34 -0500 Subject: *Clean up summon code. --HG-- branch : trunk --- src/game/Unit.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index df61c321797..5ee9bc4c5c4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8143,12 +8143,14 @@ Unit* Unit::GetCharm() const void Unit::SetMinion(Minion *minion, bool apply) { sLog.outDebug("SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); + if(minion->GetOwnerGUID() != GetGUID()) + { + sLog.outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry()); + return; + } if(apply) { - if(!minion->SetOwner(this, true)) - return; - m_Controlled.insert(minion); // Can only have one pet. If a new one is summoned, dismiss the old one. @@ -8204,9 +8206,6 @@ void Unit::SetMinion(Minion *minion, bool apply) } else { - if(!minion->SetOwner(this, false)) - return; - m_Controlled.erase(minion); if(minion->isPet() || minion->m_Properties && minion->m_Properties->Category == SUMMON_CATEGORY_PET) -- cgit v1.2.3