From a944a0ea4b30dcde2eeb9ac60c8491c417b17f69 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 11 Aug 2009 10:14:46 -0500 Subject: *Fix a crash when go is removed but m_ObjectSlot is not cleared. --HG-- branch : trunk --- src/game/Unit.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 645c1556861..68d7b1fe02a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4664,6 +4664,15 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del) gameObj->SetOwnerGUID(0); + for(uint32 i = 0; i < 4; ++i) + { + if(m_ObjectSlot[i] == gameObj->GetGUID()) + { + m_ObjectSlot[i] = 0; + break; + } + } + // GO created by some spell if (uint32 spellid = gameObj->GetSpellId()) { -- cgit v1.2.3