diff options
| author | megamage <none@none> | 2008-12-10 15:14:49 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-12-10 15:14:49 -0600 |
| commit | bcb39b263d65a52c7b21f372d92668a0504f8475 (patch) | |
| tree | ab3a5296c31544f8f896c923ffeaf2bdc1eb82a6 /src/game/Unit.cpp | |
| parent | 4182df058c0b2d01db3a5c4bf5df65e775d89ec6 (diff) | |
*Allow pets to cast devour magic on both friends and enemies.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 51fb5262855..ec3f687f0e6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8303,7 +8303,7 @@ Unit *Unit::GetCharmer() const return NULL; } -Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() +Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() const { uint64 guid = GetCharmerOrOwnerGUID(); if(IS_PLAYER_GUID(guid)) @@ -12834,4 +12834,24 @@ void Unit::SetConfused(bool apply) if(GetTypeId() == TYPEID_PLAYER) ((Player*)this)->SetClientControl(this, !apply); +} + +bool Unit::IsInPartyWith(Unit const *unit) const +{ + const Player *p1 = GetCharmerOrOwnerPlayerOrPlayerItself(); + const Player *p2 = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if(p1 && p2) + return p1->IsInSameGroupWith(p2); + else + return false; +} + +bool Unit::IsInRaidWith(Unit const *unit) const +{ + const Player *p1 = GetCharmerOrOwnerPlayerOrPlayerItself(); + const Player *p2 = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if(p1 && p2) + return p1->IsInSameRaidWith(p2); + else + return false; }
\ No newline at end of file |
