aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 4d6eab411d4..b902872ed4e 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -6699,8 +6699,8 @@ void ObjectMgr::LoadReputationRewardRate()
_repRewardRateStore.clear(); // for reload case
- uint32 count = 0; // 0 1 2 3 4 5 6
- QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, quest_daily_rate, quest_weekly_rate, quest_monthly_rate, creature_rate, spell_rate FROM reputation_reward_rate");
+ uint32 count = 0; // 0 1 2 3 4 5 6 7
+ QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, quest_daily_rate, quest_weekly_rate, quest_monthly_rate, quest_repeatable_rate, creature_rate, spell_rate FROM reputation_reward_rate");
if (!result)
{
TC_LOG_ERROR(LOG_FILTER_SERVER_LOADING, ">> Loaded `reputation_reward_rate`, table is empty!");
@@ -6719,8 +6719,9 @@ void ObjectMgr::LoadReputationRewardRate()
repRate.questDailyRate = fields[2].GetFloat();
repRate.questWeeklyRate = fields[3].GetFloat();
repRate.questMonthlyRate = fields[4].GetFloat();
- repRate.creatureRate = fields[5].GetFloat();
- repRate.spellRate = fields[6].GetFloat();
+ repRate.questRepeatableRate = fields[5].GetFloat();
+ repRate.creatureRate = fields[6].GetFloat();
+ repRate.spellRate = fields[7].GetFloat();
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
if (!factionEntry)
@@ -6753,6 +6754,12 @@ void ObjectMgr::LoadReputationRewardRate()
continue;
}
+ if (repRate.questRepeatableRate < 0.0f)
+ {
+ TC_LOG_ERROR(LOG_FILTER_SQL, "Table reputation_reward_rate has quest_repeatable_rate with invalid rate %f, skipping data for faction %u", repRate.questRepeatableRate, factionId);
+ continue;
+ }
+
if (repRate.creatureRate < 0.0f)
{
TC_LOG_ERROR(LOG_FILTER_SQL, "Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creatureRate, factionId);