diff options
author | megamage <none@none> | 2009-05-03 10:45:34 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-03 10:45:34 -0500 |
commit | f6e8ccb239eaaa98bceab708a831e163d4107a3c (patch) | |
tree | 489ed002538bd17ea047d43d8dd38acc5bb082ab /src/game/Unit.cpp | |
parent | f9b13b45e09e06ce2400c5e93a97ac2459d7159c (diff) |
*Clean up summon code.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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) |