diff options
| author | S.V <svranesevic@users.noreply.github.com> | 2017-03-21 17:27:14 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-03-21 17:27:14 +0100 |
| commit | eea16ce35630762703b8f71d31c827179c37bfc4 (patch) | |
| tree | cdf762d9acadb1a5f1c2ee2658afa2d821a11b82 /src | |
| parent | 0bfa38e9fcc385db0ebf49b404e6356aea40c4ba (diff) | |
Core/Creatures: Fixed GMs being considered in party/raid with nearby creatures without CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT
Ref #19340
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6a4f34b5554..f813fe3121c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12822,8 +12822,8 @@ bool Unit::IsInPartyWith(Unit const* unit) const if (this == unit) return true; - const Unit* u1 = GetCharmerOrOwnerOrSelf(); - const Unit* u2 = unit->GetCharmerOrOwnerOrSelf(); + Unit const* u1 = GetCharmerOrOwnerOrSelf(); + Unit const* u2 = unit->GetCharmerOrOwnerOrSelf(); if (u1 == u2) return true; @@ -12833,8 +12833,7 @@ bool Unit::IsInPartyWith(Unit const* unit) const (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return true; - // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT - return u1->getFaction() == u2->getFaction(); + return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction(); } bool Unit::IsInRaidWith(Unit const* unit) const @@ -12842,8 +12841,8 @@ bool Unit::IsInRaidWith(Unit const* unit) const if (this == unit) return true; - const Unit* u1 = GetCharmerOrOwnerOrSelf(); - const Unit* u2 = unit->GetCharmerOrOwnerOrSelf(); + Unit const* u1 = GetCharmerOrOwnerOrSelf(); + Unit const* u2 = unit->GetCharmerOrOwnerOrSelf(); if (u1 == u2) return true; @@ -12853,8 +12852,7 @@ bool Unit::IsInRaidWith(Unit const* unit) const (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)) return true; - // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT - return u1->getFaction() == u2->getFaction(); + return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction(); } void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap) |
