[10470] Fixed totem owner faction/level set for creature onwer case.

When totem created creature owner alos not in world yet.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Vinolentus 2010-09-11 14:52:30 +04:00 committed by VladimirMangos
parent 54d991ef3a
commit 73a85b0989
4 changed files with 8 additions and 11 deletions

View file

@ -109,15 +109,12 @@ void Totem::UnSummon()
AddObjectToRemoveList();
}
void Totem::SetOwner(uint64 guid)
void Totem::SetOwner(Unit* owner)
{
SetCreatorGUID(guid);
SetOwnerGUID(guid);
if (Unit *owner = GetOwner())
{
setFaction(owner->getFaction());
SetLevel(owner->getLevel());
}
SetCreatorGUID(owner->GetGUID());
SetOwnerGUID(owner->GetGUID());
setFaction(owner->getFaction());
SetLevel(owner->getLevel());
}
Unit *Totem::GetOwner()