mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11892] Really fix [11890]. This basicly reverts commit 11890
Remove the actually not required faction check in Player::GetNPCIfCanInteractWith - this is done by IsHostileTo a line before Improve the Player-login AtWar selection to also consider forced reactions Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
85309aa3c1
commit
6aab5c1022
8 changed files with 70 additions and 61 deletions
|
|
@ -1728,7 +1728,7 @@ void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
|
||||||
bool GameObject::IsHostileTo(Unit const* unit) const
|
bool GameObject::IsHostileTo(Unit const* unit) const
|
||||||
{
|
{
|
||||||
// always non-hostile to GM in GM mode
|
// always non-hostile to GM in GM mode
|
||||||
if(unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
if (unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// test owner instead if have
|
// test owner instead if have
|
||||||
|
|
@ -1739,24 +1739,28 @@ bool GameObject::IsHostileTo(Unit const* unit) const
|
||||||
return IsHostileTo(targetOwner);
|
return IsHostileTo(targetOwner);
|
||||||
|
|
||||||
// for not set faction case (wild object) use hostile case
|
// for not set faction case (wild object) use hostile case
|
||||||
if(!GetGOInfo()->faction)
|
if (!GetGOInfo()->faction)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const*tester_faction = sFactionTemplateStore.LookupEntry(GetGOInfo()->faction);
|
FactionTemplateEntry const*tester_faction = sFactionTemplateStore.LookupEntry(GetGOInfo()->faction);
|
||||||
FactionTemplateEntry const*target_faction = unit->getFactionTemplateEntry();
|
FactionTemplateEntry const*target_faction = unit->getFactionTemplateEntry();
|
||||||
if(!tester_faction || !target_faction)
|
if (!tester_faction || !target_faction)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// GvP forced reaction and reputation case
|
// GvP forced reaction and reputation case
|
||||||
if (unit->GetTypeId()==TYPEID_PLAYER)
|
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (tester_faction->faction)
|
if (tester_faction->faction)
|
||||||
{
|
{
|
||||||
|
// forced reaction
|
||||||
|
if (ReputationRank const* force = ((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||||
|
return *force <= REP_HOSTILE;
|
||||||
|
|
||||||
// apply reputation state
|
// apply reputation state
|
||||||
FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
|
FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
|
||||||
if (raw_tester_faction && raw_tester_faction->reputationListID >=0 )
|
if (raw_tester_faction && raw_tester_faction->reputationListID >= 0)
|
||||||
return ((Player const*)unit)->GetReputationMgr().GetRank(raw_tester_faction, true) <= REP_HOSTILE;
|
return ((Player const*)unit)->GetReputationMgr().GetRank(raw_tester_faction) <= REP_HOSTILE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1767,7 +1771,7 @@ bool GameObject::IsHostileTo(Unit const* unit) const
|
||||||
bool GameObject::IsFriendlyTo(Unit const* unit) const
|
bool GameObject::IsFriendlyTo(Unit const* unit) const
|
||||||
{
|
{
|
||||||
// always friendly to GM in GM mode
|
// always friendly to GM in GM mode
|
||||||
if(unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
if (unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// test owner instead if have
|
// test owner instead if have
|
||||||
|
|
@ -1778,24 +1782,28 @@ bool GameObject::IsFriendlyTo(Unit const* unit) const
|
||||||
return IsFriendlyTo(targetOwner);
|
return IsFriendlyTo(targetOwner);
|
||||||
|
|
||||||
// for not set faction case (wild object) use hostile case
|
// for not set faction case (wild object) use hostile case
|
||||||
if(!GetGOInfo()->faction)
|
if (!GetGOInfo()->faction)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const*tester_faction = sFactionTemplateStore.LookupEntry(GetGOInfo()->faction);
|
FactionTemplateEntry const*tester_faction = sFactionTemplateStore.LookupEntry(GetGOInfo()->faction);
|
||||||
FactionTemplateEntry const*target_faction = unit->getFactionTemplateEntry();
|
FactionTemplateEntry const*target_faction = unit->getFactionTemplateEntry();
|
||||||
if(!tester_faction || !target_faction)
|
if (!tester_faction || !target_faction)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// GvP forced reaction and reputation case
|
// GvP forced reaction and reputation case
|
||||||
if (unit->GetTypeId()==TYPEID_PLAYER)
|
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (tester_faction->faction)
|
if (tester_faction->faction)
|
||||||
{
|
{
|
||||||
|
// forced reaction
|
||||||
|
if (ReputationRank const* force =((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||||
|
return *force >= REP_FRIENDLY;
|
||||||
|
|
||||||
// apply reputation state
|
// apply reputation state
|
||||||
if (FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
|
if (FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
|
||||||
if (raw_tester_faction->reputationListID >=0 )
|
if (raw_tester_faction->reputationListID >= 0)
|
||||||
return ((Player const*)unit)->GetReputationMgr().GetRank(raw_tester_faction, true) >= REP_FRIENDLY;
|
return ((Player const*)unit)->GetReputationMgr().GetRank(raw_tester_faction) >= REP_FRIENDLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1361,7 +1361,7 @@ void ChatHandler::ShowFactionListHelper( FactionEntry const * factionEntry, Loca
|
||||||
|
|
||||||
if (repState) // and then target!=NULL also
|
if (repState) // and then target!=NULL also
|
||||||
{
|
{
|
||||||
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry, false);
|
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
|
||||||
std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
|
std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
|
||||||
|
|
||||||
ss << " " << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ")";
|
ss << " " << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ")";
|
||||||
|
|
|
||||||
|
|
@ -7482,7 +7482,7 @@ bool PlayerCondition::Meets(Player const * player) const
|
||||||
case CONDITION_REPUTATION_RANK:
|
case CONDITION_REPUTATION_RANK:
|
||||||
{
|
{
|
||||||
FactionEntry const* faction = sFactionStore.LookupEntry(value1);
|
FactionEntry const* faction = sFactionStore.LookupEntry(value1);
|
||||||
return faction && player->GetReputationMgr().GetRank(faction, false) >= ReputationRank(value2);
|
return faction && player->GetReputationMgr().GetRank(faction) >= ReputationRank(value2);
|
||||||
}
|
}
|
||||||
case CONDITION_TEAM:
|
case CONDITION_TEAM:
|
||||||
return uint32(player->GetTeam()) == value1;
|
return uint32(player->GetTeam()) == value1;
|
||||||
|
|
|
||||||
|
|
@ -2180,15 +2180,8 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
||||||
if (unit->IsHostileTo(this))
|
if (unit->IsHostileTo(this))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// not unfriendly
|
|
||||||
if(FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction()))
|
|
||||||
if(factionTemplate->faction)
|
|
||||||
if(FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction))
|
|
||||||
if(faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction, true) <= REP_UNFRIENDLY)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// not too far
|
// not too far
|
||||||
if(!unit->IsWithinDistInMap(this,INTERACTION_DISTANCE))
|
if (!unit->IsWithinDistInMap(this, INTERACTION_DISTANCE))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return unit;
|
return unit;
|
||||||
|
|
@ -6229,7 +6222,7 @@ void Player::setFactionForRace(uint8 race)
|
||||||
ReputationRank Player::GetReputationRank(uint32 faction) const
|
ReputationRank Player::GetReputationRank(uint32 faction) const
|
||||||
{
|
{
|
||||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction);
|
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction);
|
||||||
return GetReputationMgr().GetRank(factionEntry, false);
|
return GetReputationMgr().GetRank(factionEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calculate total reputation percent player gain with quest/creature level
|
//Calculate total reputation percent player gain with quest/creature level
|
||||||
|
|
@ -6310,7 +6303,7 @@ void Player::RewardReputation(Unit *pVictim, float rate)
|
||||||
int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue1, Rep->repfaction1, pVictim->getLevel());
|
int32 donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue1, Rep->repfaction1, pVictim->getLevel());
|
||||||
donerep1 = int32(donerep1*rate);
|
donerep1 = int32(donerep1*rate);
|
||||||
FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1);
|
FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1);
|
||||||
uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1, false);
|
uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
|
||||||
if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
|
if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
|
||||||
GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
|
GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
|
||||||
|
|
||||||
|
|
@ -6328,7 +6321,7 @@ void Player::RewardReputation(Unit *pVictim, float rate)
|
||||||
int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue2, Rep->repfaction2, pVictim->getLevel());
|
int32 donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, Rep->repvalue2, Rep->repfaction2, pVictim->getLevel());
|
||||||
donerep2 = int32(donerep2*rate);
|
donerep2 = int32(donerep2*rate);
|
||||||
FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2);
|
FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2);
|
||||||
uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2, false);
|
uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
|
||||||
if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
|
if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
|
||||||
GetReputationMgr().ModifyReputation(factionEntry2, donerep2);
|
GetReputationMgr().ModifyReputation(factionEntry2, donerep2);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,14 +74,8 @@ int32 ReputationMgr::GetReputation(FactionEntry const* factionEntry) const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReputationRank ReputationMgr::GetRank(FactionEntry const* factionEntry, bool withForcedReaction) const
|
ReputationRank ReputationMgr::GetRank(FactionEntry const* factionEntry) const
|
||||||
{
|
{
|
||||||
if (withForcedReaction)
|
|
||||||
{
|
|
||||||
ForcedReactions::const_iterator find = m_forcedReactions.find(factionEntry->ID);
|
|
||||||
if (find != m_forcedReactions.end())
|
|
||||||
return find->second;
|
|
||||||
}
|
|
||||||
int32 reputation = GetReputation(factionEntry);
|
int32 reputation = GetReputation(factionEntry);
|
||||||
return ReputationToRank(reputation);
|
return ReputationToRank(reputation);
|
||||||
}
|
}
|
||||||
|
|
@ -286,7 +280,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||||
{
|
{
|
||||||
if (FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr))
|
if (FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr))
|
||||||
{
|
{
|
||||||
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc, false) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
|
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
|
||||||
continue;
|
continue;
|
||||||
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
|
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
|
||||||
if (spilloverRep != 0 || !incremental)
|
if (spilloverRep != 0 || !incremental)
|
||||||
|
|
@ -492,11 +486,17 @@ void ReputationMgr::LoadFromDB(QueryResult *result)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set atWar for hostile
|
// set atWar for hostile
|
||||||
if(GetRank(factionEntry, true) <= REP_HOSTILE)
|
ForcedReactions::const_iterator forceItr = m_forcedReactions.find(factionEntry->ID);
|
||||||
SetAtWar(faction,true);
|
if (forceItr != m_forcedReactions.end())
|
||||||
|
{
|
||||||
|
if (forceItr->second <= REP_HOSTILE)
|
||||||
|
SetAtWar(faction, true);
|
||||||
|
}
|
||||||
|
else if (GetRank(factionEntry) <= REP_HOSTILE)
|
||||||
|
SetAtWar(faction, true);
|
||||||
|
|
||||||
// reset changed flag if values similar to saved in DB
|
// reset changed flag if values similar to saved in DB
|
||||||
if(faction->Flags==dbFactionFlags)
|
if (faction->Flags == dbFactionFlags)
|
||||||
{
|
{
|
||||||
faction->needSend = false;
|
faction->needSend = false;
|
||||||
faction->needSave = false;
|
faction->needSave = false;
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class ReputationMgr
|
||||||
int32 GetReputation(FactionEntry const* factionEntry) const;
|
int32 GetReputation(FactionEntry const* factionEntry) const;
|
||||||
int32 GetBaseReputation(FactionEntry const* factionEntry) const;
|
int32 GetBaseReputation(FactionEntry const* factionEntry) const;
|
||||||
|
|
||||||
ReputationRank GetRank(FactionEntry const* factionEntry, bool withForcedReaction) const;
|
ReputationRank GetRank(FactionEntry const* factionEntry) const;
|
||||||
ReputationRank GetBaseRank(FactionEntry const* factionEntry) const;
|
ReputationRank GetBaseRank(FactionEntry const* factionEntry) const;
|
||||||
|
|
||||||
ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const
|
ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const
|
||||||
|
|
|
||||||
|
|
@ -5419,38 +5419,42 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const*tester_faction = tester->getFactionTemplateEntry();
|
FactionTemplateEntry const* tester_faction = tester->getFactionTemplateEntry();
|
||||||
FactionTemplateEntry const*target_faction = target->getFactionTemplateEntry();
|
FactionTemplateEntry const* target_faction = target->getFactionTemplateEntry();
|
||||||
if(!tester_faction || !target_faction)
|
if (!tester_faction || !target_faction)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(target->isAttackingPlayer() && tester->IsContestedGuard())
|
if (target->isAttackingPlayer() && tester->IsContestedGuard())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// PvC forced reaction and reputation case
|
// PvC forced reaction and reputation case
|
||||||
if(tester->GetTypeId()==TYPEID_PLAYER)
|
if (tester->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
if (target_faction->faction)
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if(target_faction->faction)
|
if (ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
|
||||||
{
|
|
||||||
if(ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
|
|
||||||
return *force <= REP_HOSTILE;
|
return *force <= REP_HOSTILE;
|
||||||
|
|
||||||
// if faction have reputation then hostile state for tester at 100% dependent from at_war state
|
// if faction have reputation then hostile state for tester at 100% dependent from at_war state
|
||||||
if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
|
if (FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
|
||||||
if(FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
|
if (FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
|
||||||
return (factionState->Flags & FACTION_FLAG_AT_WAR);
|
return (factionState->Flags & FACTION_FLAG_AT_WAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CvP forced reaction and reputation case
|
// CvP forced reaction and reputation case
|
||||||
else if (target->GetTypeId()==TYPEID_PLAYER)
|
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (tester_faction->faction)
|
if (tester_faction->faction)
|
||||||
{
|
{
|
||||||
|
// forced reaction
|
||||||
|
if (ReputationRank const* force = ((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||||
|
return *force <= REP_HOSTILE;
|
||||||
|
|
||||||
// apply reputation state
|
// apply reputation state
|
||||||
FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
|
FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
|
||||||
if (raw_tester_faction && raw_tester_faction->reputationListID >=0 )
|
if (raw_tester_faction && raw_tester_faction->reputationListID >= 0)
|
||||||
return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction, true) <= REP_HOSTILE;
|
return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction) <= REP_HOSTILE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5529,36 +5533,40 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const*tester_faction = tester->getFactionTemplateEntry();
|
FactionTemplateEntry const*tester_faction = tester->getFactionTemplateEntry();
|
||||||
FactionTemplateEntry const*target_faction = target->getFactionTemplateEntry();
|
FactionTemplateEntry const*target_faction = target->getFactionTemplateEntry();
|
||||||
if(!tester_faction || !target_faction)
|
if (!tester_faction || !target_faction)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(target->isAttackingPlayer() && tester->IsContestedGuard())
|
if (target->isAttackingPlayer() && tester->IsContestedGuard())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// PvC forced reaction and reputation case
|
// PvC forced reaction and reputation case
|
||||||
if(tester->GetTypeId()==TYPEID_PLAYER)
|
if (tester->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
if (target_faction->faction)
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if(target_faction->faction)
|
if (ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
|
||||||
{
|
|
||||||
if(ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
|
|
||||||
return *force >= REP_FRIENDLY;
|
return *force >= REP_FRIENDLY;
|
||||||
|
|
||||||
// if faction have reputation then friendly state for tester at 100% dependent from at_war state
|
// if faction have reputation then friendly state for tester at 100% dependent from at_war state
|
||||||
if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
|
if (FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
|
||||||
if(FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
|
if (FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
|
||||||
return !(factionState->Flags & FACTION_FLAG_AT_WAR);
|
return !(factionState->Flags & FACTION_FLAG_AT_WAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CvP forced reaction and reputation case
|
// CvP forced reaction and reputation case
|
||||||
else if (target->GetTypeId()==TYPEID_PLAYER)
|
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (tester_faction->faction)
|
if (tester_faction->faction)
|
||||||
{
|
{
|
||||||
|
// forced reaction
|
||||||
|
if (ReputationRank const* force =((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||||
|
return *force >= REP_FRIENDLY;
|
||||||
|
|
||||||
// apply reputation state
|
// apply reputation state
|
||||||
if (FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
|
if (FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
|
||||||
if (raw_tester_faction->reputationListID >=0 )
|
if (raw_tester_faction->reputationListID >=0 )
|
||||||
return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction, true) >= REP_FRIENDLY;
|
return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction) >= REP_FRIENDLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11891"
|
#define REVISION_NR "11892"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue