Replace some assert with return statement, fixed some crash bugs

--HG--
branch : trunk
This commit is contained in:
n0n4m3 committed 2009-12-17 06:49:36 +01:00
1 parent 3e03b0aa2d
commit 365f0ae562
4 files changed
+21 -8

No files matched your search

+5 -2
View File
@@ -4481,7 +4481,9 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
void Unit::AddGameObject(GameObject* gameObj)
{
assert(gameObj && gameObj->GetOwnerGUID()==0);
if(!gameObj || !gameObj->GetOwnerGUID()==0)
return;
m_gameObj.push_back(gameObj);
gameObj->SetOwnerGUID(GetGUID());
@@ -4497,7 +4499,8 @@ void Unit::AddGameObject(GameObject* gameObj)
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
{
assert(gameObj && gameObj->GetOwnerGUID()==GetGUID());
if(!gameObj || !gameObj->GetOwnerGUID()==GetGUID())
return;
gameObj->SetOwnerGUID(0);