diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0dcf535c4b5..b7a731aaa12 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8074,10 +8074,9 @@ bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Cas Unit *Unit::GetOwner() const { - uint64 ownerid = GetOwnerGUID(); - if(!ownerid) - return NULL; - return ObjectAccessor::GetUnit(*this, ownerid); + if(uint64 ownerid = GetOwnerGUID()) + return ObjectAccessor::GetUnit(*this, ownerid); + return NULL; } Unit *Unit::GetCharmer() const |