wip
This commit is contained in:
@@ -29,6 +29,20 @@ const int32 ReputationMgr::PointsInRank[MAX_REPUTATION_RANK] = {36000, 3000, 300
|
||||
const int32 ReputationMgr::Reputation_Cap = 42999;
|
||||
const int32 ReputationMgr::Reputation_Bottom = -42000;
|
||||
|
||||
namespace
|
||||
{
|
||||
uint32 GetEffectiveReputationRaceMask(Player const* player)
|
||||
{
|
||||
// Always use the player's actual race mask so the server BaseRep calculation
|
||||
// matches what the client computes (client always uses the original race, not
|
||||
// the current team). This is correct for both the race-change service (where
|
||||
// getRace() already reflects the new race) and for game modes like Traitor
|
||||
// that swap team without changing race (where the original race mask is the
|
||||
// right baseline for reputation display and incremental gain alike).
|
||||
return player->getRaceMask();
|
||||
}
|
||||
}
|
||||
|
||||
ReputationRank ReputationMgr::ReputationToRank(int32 standing)
|
||||
{
|
||||
int32 limit = Reputation_Cap + 1;
|
||||
@@ -93,7 +107,7 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
|
||||
if (!factionEntry)
|
||||
return 0;
|
||||
|
||||
uint32 raceMask = _player->getRaceMask();
|
||||
uint32 raceMask = GetEffectiveReputationRaceMask(_player);
|
||||
uint32 classMask = _player->getClassMask();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -147,7 +161,7 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con
|
||||
if (!factionEntry)
|
||||
return 0;
|
||||
|
||||
uint32 raceMask = _player->getRaceMask();
|
||||
uint32 raceMask = GetEffectiveReputationRaceMask(_player);
|
||||
uint32 classMask = _player->getClassMask();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -464,9 +478,17 @@ void ReputationMgr::SetVisible(FactionTemplateEntry const* factionTemplateEntry)
|
||||
return;
|
||||
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
|
||||
{
|
||||
if (_player->GetTeamId() != _player->GetTeamId(true))
|
||||
{
|
||||
SetVisible(factionEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
// Never show factions of the opposing team
|
||||
if (!(factionEntry->BaseRepRaceMask[1] & _player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom))
|
||||
SetVisible(factionEntry);
|
||||
}
|
||||
}
|
||||
|
||||
void ReputationMgr::SetVisible(FactionEntry const* factionEntry)
|
||||
|
||||
Reference in New Issue
Block a user