summaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorAlyst3r <59404251+Alyst3r@users.noreply.github.com>2023-10-22 04:45:50 +0200
committerGitHub <noreply@github.com>2023-10-22 04:45:50 +0200
commit2e55cad450815788c503fe2902dd248902e6d85b (patch)
treee756a8d04597aa4e883a53d3e6bd4c146d677f14 /src/server/game/Globals/ObjectMgr.cpp
parent900ca087c9b612ce433cd52116772b6a896585b8 (diff)
refactor(DB/reputation_spillover_template): Reputation spillover table expansion (#14763)
* Update ObjectMgr.cpp Rework to `ObjectMgr::LoadReputationSpilloverTemplate()` allowing more factons to be added. * Create reputation_spillover_template-update.sql Alteration to `reputation_spillover_template` table, update allowing to add two more factions. * Update SharedDefines.h `MAX_SPILLOVER_FACTIONS` is now equal 6 instead of 4. * Update reputation_spillover_template-update.sql Now it alters table instead recreating it.
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 80804e9b5a..ca07350a29 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -7676,8 +7676,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
_repSpilloverTemplateStore.clear(); // for reload case
- uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12
- QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
+ uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
+ QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4, faction5, rate_5, rank_5, faction6, rate_6, rank_6 FROM reputation_spillover_template");
if (!result)
{
@@ -7706,6 +7706,12 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
repTemplate.faction[3] = fields[10].Get<uint16>();
repTemplate.faction_rate[3] = fields[11].Get<float>();
repTemplate.faction_rank[3] = fields[12].Get<uint8>();
+ repTemplate.faction[4] = fields[13].Get<uint16>();
+ repTemplate.faction_rate[4] = fields[14].Get<float>();
+ repTemplate.faction_rank[4] = fields[15].Get<uint8>();
+ repTemplate.faction[5] = fields[16].Get<uint16>();
+ repTemplate.faction_rate[5] = fields[17].Get<float>();
+ repTemplate.faction_rank[5] = fields[18].Get<uint8>();
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);