aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1264f1128e7..f166bbdf985 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -20268,7 +20268,13 @@ void Player::_SaveStats(CharacterDatabaseTransaction trans) const
stmt->setFloat(index++, GetFloatValue(PLAYER_PARRY_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_CRIT_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE));
- stmt->setFloat(index++, GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1));
+
+ // Store the max spell scrit percentage out of all the possible schools
+ float spellCrit = 0.0f;
+ for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
+ spellCrit = std::max(spellCrit, GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + i));
+ stmt->setFloat(index++, spellCrit);
+
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER));
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER));
stmt->setUInt32(index++, GetBaseSpellPowerBonus());