mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core/WorldSession): change how to storing data in account_tutorial (#1563)
* Core/Misc Created handler for character creation * fix(Core/DB): Error message when the password is longer than 16 char when creating an account * Update rev_1551539925032805900.sql * Update AccountMgr.cpp * fix(Core/DB): account_tutorial now storing data * clean
This commit is contained in:
@@ -804,15 +804,12 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
|
||||
if (!m_TutorialsChanged)
|
||||
return;
|
||||
|
||||
bool hasTutorials = false;
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
if (m_Tutorials[i] != 0)
|
||||
{
|
||||
hasTutorials = true;
|
||||
break;
|
||||
}
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_HAS_TUTORIALS);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
bool hasTutorials = bool(CharacterDatabase.Query(stmt));
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
|
||||
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
|
||||
stmt->setUInt32(i, m_Tutorials[i]);
|
||||
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());
|
||||
|
||||
Reference in New Issue
Block a user