mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/DBLayer: Converted player login queries into prepared statements
Core/DBLayer: Added missing implementation for SQLQueryHolder::SetPreparedQuery --HG-- branch : trunk
This commit is contained in:
@@ -452,7 +452,7 @@ void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
|
||||
faction->Changed = true;
|
||||
}
|
||||
|
||||
void ReputationMgr::LoadFromDB(QueryResult result)
|
||||
void ReputationMgr::LoadFromDB(PreparedQueryResult result)
|
||||
{
|
||||
// Set initial reputations (so everything is nifty before DB data load)
|
||||
Initialize();
|
||||
@@ -463,23 +463,21 @@ void ReputationMgr::LoadFromDB(QueryResult result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
FactionEntry const *factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt32());
|
||||
FactionEntry const *factionEntry = sFactionStore.LookupEntry(result->GetUInt32(0));
|
||||
if (factionEntry && (factionEntry->reputationListID >= 0))
|
||||
{
|
||||
FactionState* faction = &m_factions[factionEntry->reputationListID];
|
||||
|
||||
// update standing to current
|
||||
faction->Standing = int32(fields[1].GetUInt32());
|
||||
faction->Standing = int32(result->GetUInt32(1));
|
||||
|
||||
// update counters
|
||||
int32 BaseRep = GetBaseReputation(factionEntry);
|
||||
ReputationRank old_rank = ReputationToRank(BaseRep);
|
||||
ReputationRank new_rank = ReputationToRank(BaseRep + faction->Standing);
|
||||
UpdateRankCounters(old_rank,new_rank);
|
||||
UpdateRankCounters(old_rank, new_rank);
|
||||
|
||||
uint32 dbFactionFlags = fields[2].GetUInt32();
|
||||
uint32 dbFactionFlags = result->GetUInt32(2);
|
||||
|
||||
if (dbFactionFlags & FACTION_FLAG_VISIBLE)
|
||||
SetVisible(faction); // have internal checks for forced invisibility
|
||||
|
||||
Reference in New Issue
Block a user