Code style (game + scripts only):
"( " --> "("
" )" --> ")"
--HG--
branch : trunk
This commit is contained in:
1 parent
d19e127080
commit
49d05ba9aa
176 files changed
+4789
-4789
No files matched your search
+28
-28
@@ -30,7 +30,7 @@ ReputationRank ReputationMgr::ReputationToRank(int32 standing)
|
||||
for (int i = MAX_REPUTATION_RANK-1; i >= MIN_REPUTATION_RANK; --i)
|
||||
{
|
||||
limit -= PointsInRank[i];
|
||||
if (standing >= limit )
|
||||
if (standing >= limit)
|
||||
return ReputationRank(i);
|
||||
}
|
||||
return MIN_REPUTATION_RANK;
|
||||
@@ -58,12 +58,12 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
|
||||
uint32 classMask = m_player->getClassMask();
|
||||
for (int i=0; i < 4; i++)
|
||||
{
|
||||
if ( (factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
(factionEntry->BaseRepRaceMask[i] == 0 &&
|
||||
factionEntry->BaseRepClassMask[i] != 0 ) ) &&
|
||||
factionEntry->BaseRepClassMask[i] != 0)) &&
|
||||
(factionEntry->BaseRepClassMask[i] & classMask ||
|
||||
factionEntry->BaseRepClassMask[i] == 0 )
|
||||
)
|
||||
factionEntry->BaseRepClassMask[i] == 0)
|
||||
)
|
||||
return factionEntry->BaseRepValue[i];
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ ReputationRank ReputationMgr::GetBaseRank(FactionEntry const* factionEntry) cons
|
||||
return ReputationToRank(reputation);
|
||||
}
|
||||
|
||||
void ReputationMgr::ApplyForceReaction( uint32 faction_id,ReputationRank rank,bool apply )
|
||||
void ReputationMgr::ApplyForceReaction(uint32 faction_id,ReputationRank rank,bool apply)
|
||||
{
|
||||
if (apply)
|
||||
m_forcedReactions[faction_id] = rank;
|
||||
@@ -112,12 +112,12 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con
|
||||
uint32 classMask = m_player->getClassMask();
|
||||
for (int i=0; i < 4; i++)
|
||||
{
|
||||
if ( (factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
(factionEntry->BaseRepRaceMask[i] == 0 &&
|
||||
factionEntry->BaseRepClassMask[i] != 0 ) ) &&
|
||||
factionEntry->BaseRepClassMask[i] != 0)) &&
|
||||
(factionEntry->BaseRepClassMask[i] & classMask ||
|
||||
factionEntry->BaseRepClassMask[i] == 0 )
|
||||
)
|
||||
factionEntry->BaseRepClassMask[i] == 0)
|
||||
)
|
||||
return factionEntry->ReputationFlags[i];
|
||||
}
|
||||
return 0;
|
||||
@@ -214,7 +214,7 @@ void ReputationMgr::Initialize()
|
||||
{
|
||||
FactionEntry const *factionEntry = sFactionStore.LookupEntry(i);
|
||||
|
||||
if ( factionEntry && (factionEntry->reputationListID >= 0))
|
||||
if (factionEntry && (factionEntry->reputationListID >= 0))
|
||||
{
|
||||
FactionState newFaction;
|
||||
newFaction.ID = factionEntry->ID;
|
||||
@@ -223,7 +223,7 @@ void ReputationMgr::Initialize()
|
||||
newFaction.Flags = GetDefaultStateFlags(factionEntry);
|
||||
newFaction.Changed = true;
|
||||
|
||||
if ( newFaction.Flags & FACTION_FLAG_VISIBLE )
|
||||
if (newFaction.Flags & FACTION_FLAG_VISIBLE)
|
||||
++m_visibleFactionCount;
|
||||
|
||||
UpdateRankCounters(REP_HOSTILE,GetBaseRank(factionEntry));
|
||||
@@ -323,7 +323,7 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
|
||||
if (incremental)
|
||||
{
|
||||
// int32 *= float cause one point loss?
|
||||
standing = floor( (float)standing * sWorld.getRate(RATE_REPUTATION_GAIN) + 0.5 );
|
||||
standing = floor((float)standing * sWorld.getRate(RATE_REPUTATION_GAIN) + 0.5);
|
||||
standing += itr->second.Standing + BaseRep;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry)
|
||||
|
||||
if (FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
|
||||
// Never show factions of the opposing team
|
||||
if (!(factionEntry->BaseRepRaceMask[1] & m_player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom) )
|
||||
if (!(factionEntry->BaseRepRaceMask[1] & m_player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom))
|
||||
SetVisible(factionEntry);
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ void ReputationMgr::SetVisible(FactionState* faction)
|
||||
{
|
||||
// always invisible or hidden faction can't be make visible
|
||||
// except if faction has FACTION_FLAG_SPECIAL
|
||||
if (faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN) && !(faction->Flags & FACTION_FLAG_SPECIAL) )
|
||||
if (faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN) && !(faction->Flags & FACTION_FLAG_SPECIAL))
|
||||
return;
|
||||
|
||||
// already set
|
||||
@@ -401,14 +401,14 @@ void ReputationMgr::SetVisible(FactionState* faction)
|
||||
SendVisible(faction);
|
||||
}
|
||||
|
||||
void ReputationMgr::SetAtWar( RepListID repListID, bool on )
|
||||
void ReputationMgr::SetAtWar(RepListID repListID, bool on)
|
||||
{
|
||||
FactionStateList::iterator itr = m_factions.find(repListID);
|
||||
if (itr == m_factions.end())
|
||||
return;
|
||||
|
||||
// always invisible or hidden faction can't change war state
|
||||
if (itr->second.Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN) )
|
||||
if (itr->second.Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN))
|
||||
return;
|
||||
|
||||
SetAtWar(&itr->second,on);
|
||||
@@ -417,14 +417,14 @@ void ReputationMgr::SetAtWar( RepListID repListID, bool on )
|
||||
void ReputationMgr::SetAtWar(FactionState* faction, bool atWar)
|
||||
{
|
||||
// not allow declare war to own faction
|
||||
if (atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED) )
|
||||
if (atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED))
|
||||
return;
|
||||
|
||||
// already set
|
||||
if (((faction->Flags & FACTION_FLAG_AT_WAR) != 0) == atWar)
|
||||
return;
|
||||
|
||||
if ( atWar )
|
||||
if (atWar)
|
||||
faction->Flags |= FACTION_FLAG_AT_WAR;
|
||||
else
|
||||
faction->Flags &= ~FACTION_FLAG_AT_WAR;
|
||||
@@ -432,7 +432,7 @@ void ReputationMgr::SetAtWar(FactionState* faction, bool atWar)
|
||||
faction->Changed = true;
|
||||
}
|
||||
|
||||
void ReputationMgr::SetInactive( RepListID repListID, bool on )
|
||||
void ReputationMgr::SetInactive(RepListID repListID, bool on)
|
||||
{
|
||||
FactionStateList::iterator itr = m_factions.find(repListID);
|
||||
if (itr == m_factions.end())
|
||||
@@ -444,7 +444,7 @@ void ReputationMgr::SetInactive( RepListID repListID, bool on )
|
||||
void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
|
||||
{
|
||||
// always invisible or hidden faction can't be inactive
|
||||
if (inactive && ((faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) || !(faction->Flags & FACTION_FLAG_VISIBLE) ) )
|
||||
if (inactive && ((faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) || !(faction->Flags & FACTION_FLAG_VISIBLE)))
|
||||
return;
|
||||
|
||||
// already set
|
||||
@@ -473,7 +473,7 @@ void ReputationMgr::LoadFromDB(QueryResult_AutoPtr result)
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
FactionEntry const *factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt32());
|
||||
if ( factionEntry && (factionEntry->reputationListID >= 0))
|
||||
if (factionEntry && (factionEntry->reputationListID >= 0))
|
||||
{
|
||||
FactionState* faction = &m_factions[factionEntry->reputationListID];
|
||||
|
||||
@@ -488,18 +488,18 @@ void ReputationMgr::LoadFromDB(QueryResult_AutoPtr result)
|
||||
|
||||
uint32 dbFactionFlags = fields[2].GetUInt32();
|
||||
|
||||
if ( dbFactionFlags & FACTION_FLAG_VISIBLE )
|
||||
if (dbFactionFlags & FACTION_FLAG_VISIBLE)
|
||||
SetVisible(faction); // have internal checks for forced invisibility
|
||||
|
||||
if ( dbFactionFlags & FACTION_FLAG_INACTIVE)
|
||||
if (dbFactionFlags & FACTION_FLAG_INACTIVE)
|
||||
SetInactive(faction,true); // have internal checks for visibility requirement
|
||||
|
||||
if ( dbFactionFlags & FACTION_FLAG_AT_WAR ) // DB at war
|
||||
if (dbFactionFlags & FACTION_FLAG_AT_WAR) // DB at war
|
||||
SetAtWar(faction,true); // have internal checks for FACTION_FLAG_PEACE_FORCED
|
||||
else // DB not at war
|
||||
{
|
||||
// allow remove if visible (and then not FACTION_FLAG_INVISIBLE_FORCED or FACTION_FLAG_HIDDEN)
|
||||
if ( faction->Flags & FACTION_FLAG_VISIBLE )
|
||||
if (faction->Flags & FACTION_FLAG_VISIBLE)
|
||||
SetAtWar(faction,false); // have internal checks for FACTION_FLAG_PEACE_FORCED
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ void ReputationMgr::LoadFromDB(QueryResult_AutoPtr result)
|
||||
faction->Changed = false;
|
||||
}
|
||||
}
|
||||
while ( result->NextRow() );
|
||||
while (result->NextRow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ void ReputationMgr::SaveToDB()
|
||||
}
|
||||
}
|
||||
|
||||
void ReputationMgr::UpdateRankCounters( ReputationRank old_rank, ReputationRank new_rank )
|
||||
void ReputationMgr::UpdateRankCounters(ReputationRank old_rank, ReputationRank new_rank)
|
||||
{
|
||||
if (old_rank >= REP_EXALTED)
|
||||
--m_exaltedFactionCount;
|
||||
|
||||
Reference in new issue
Block a user