diff options
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) |