Skip to content

Commit

Permalink
Merge pull request TrinityCore#11627 from Rochet2/OnPlayerSave
Browse files Browse the repository at this point in the history
Core/Players: Call sScriptMgr::OnPlayerSave inside Player::SaveToDB rather than before calling it.
  • Loading branch information
Warpten committed Mar 9, 2014
2 parents c7bbc1e + 94d2b91 commit a52ec67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/game/Entities/Player/Player.cpp
Expand Up @@ -1776,7 +1776,6 @@ void Player::Update(uint32 p_time)
if (p_time >= m_nextSave)
{
// m_nextSave reset in SaveToDB call
sScriptMgr->OnPlayerSave(this);
SaveToDB();
TC_LOG_DEBUG("entities.player", "Player '%s' (GUID: %u) saved", GetName().c_str(), GetGUIDLow());
}
Expand Down Expand Up @@ -19132,6 +19131,9 @@ void Player::SaveToDB(bool create /*=false*/)
TC_LOG_DEBUG("entities.unit", "The value of player %s at save: ", m_name.c_str());
outDebugValues();

if (!create)
sScriptMgr->OnPlayerSave(this);

PreparedStatement* stmt = NULL;
uint8 index = 0;

Expand Down

0 comments on commit a52ec67

Please sign in to comment.