fix(Core): Save bonus talent points to DB (#14099)

* fix(Core): Save bonus talent points to DB

* fix(Core): Save bonus talent points to DB

* Oxford comma in comment
This commit is contained in:
ZhengPeiRu21
2023-04-22 07:09:18 -06:00
committed by GitHub
parent 8696e7be7f
commit 1e26cdbee9
4 changed files with 15 additions and 7 deletions

View File

@@ -14710,6 +14710,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
stmt->SetData(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
stmt->SetData(index++, m_grantableLevels);
stmt->SetData(index++, _innTriggerId);
stmt->SetData(index++, m_extraBonusTalentCount);
}
else
{
@@ -14849,6 +14850,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
stmt->SetData(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
stmt->SetData(index++, m_grantableLevels);
stmt->SetData(index++, _innTriggerId);
stmt->SetData(index++, m_extraBonusTalentCount);
stmt->SetData(index++, IsInWorld() && !GetSession()->PlayerLogout() ? 1 : 0);
// Index

View File

@@ -4954,8 +4954,8 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, "
// 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
//"health, power1, power2, power3, power4, power5, power6, power7, instance_id, talentGroupsCount, activeTalentGroup, exploredZones, equipmentCache, ammoId, knownTitles,
// 70 71 72
//"actionBars, grantableLevels, innTriggerId FROM characters WHERE guid = '{}'", guid);
// 70 71 72 73
//"actionBars, grantableLevels, innTriggerId, extraBonusTalentCount FROM characters WHERE guid = '{}'", guid);
PreparedQueryResult result = holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
if (!result)
@@ -5473,7 +5473,10 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
_LoadMonthlyQuestStatus(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS));
_LoadRandomBGStatus(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_RANDOM_BG));
// after spell and quest load
// Extra Bonus Talent Points
m_extraBonusTalentCount = fields[73].Get<uint8>();
// after spell, bonus talents, and quest load
InitTalentForLevel();
// must be before inventory (some items required reputation check)