Core/Entities: Allow 2 side parties to work.
This commit is contained in:
@@ -9239,6 +9239,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function based on function Unit::UnitReaction from 13850 client
|
||||||
ReputationRank Unit::GetReactionTo(Unit const* target) const
|
ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||||
{
|
{
|
||||||
// always friendly to self
|
// always friendly to self
|
||||||
@@ -9268,7 +9269,9 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
|
|||||||
|
|
||||||
// same group - checks dependant only on our faction - skip FFA_PVP for example
|
// same group - checks dependant only on our faction - skip FFA_PVP for example
|
||||||
if (selfPlayerOwner->IsInRaidWith(targetPlayerOwner))
|
if (selfPlayerOwner->IsInRaidWith(targetPlayerOwner))
|
||||||
return GetFactionReactionTo(getFactionTemplateEntry(), target);
|
return REP_FRIENDLY; // return true to allow config option AllowTwoSide.Interaction.Group to work
|
||||||
|
// however client seems to allow mixed group parties, because in 13850 client it works like:
|
||||||
|
// return GetFactionReactionTo(getFactionTemplateEntry(), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check FFA_PVP
|
// check FFA_PVP
|
||||||
@@ -12368,6 +12371,7 @@ bool Unit::IsValidAttackTarget(Unit const* target) const
|
|||||||
return _IsValidAttackTarget(target, NULL);
|
return _IsValidAttackTarget(target, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function based on function Unit::CanAttack from 13850 client
|
||||||
bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const
|
bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const
|
||||||
{
|
{
|
||||||
ASSERT(target);
|
ASSERT(target);
|
||||||
@@ -12435,6 +12439,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// PvP case - can't attack when attacker or target are in sanctuary
|
// PvP case - can't attack when attacker or target are in sanctuary
|
||||||
|
// however, 13850 client doesn't allow to attack when one of the unit's has sanctuary flag and is pvp
|
||||||
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)
|
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)
|
||||||
&& ((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_SANCTUARY) || (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_SANCTUARY)))
|
&& ((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_SANCTUARY) || (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_SANCTUARY)))
|
||||||
return false;
|
return false;
|
||||||
@@ -12460,6 +12465,7 @@ bool Unit::IsValidAssistTarget(Unit const* target) const
|
|||||||
return _IsValidAssistTarget(target, NULL);
|
return _IsValidAssistTarget(target, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function based on function Unit::CanAssist from 13850 client
|
||||||
bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const
|
bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const
|
||||||
{
|
{
|
||||||
ASSERT(target);
|
ASSERT(target);
|
||||||
|
|||||||
Reference in New Issue
Block a user