Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11627 from Rochet2/OnPlayerSave

Core/Players: Call sScriptMgr::OnPlayerSave inside Player::SaveToDB rather than before calling it.
  • Loading branch information...
commit d4416c0439e7f50b7a737894d1957c5be4d2df15 2 parents 96e0a7d + 1f98435
@Warpten Warpten authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/server/game/Entities/Player/Player.cpp
View
4 src/server/game/Entities/Player/Player.cpp
@@ -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());
}
@@ -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;

0 comments on commit d4416c0

Please sign in to comment.
Something went wrong with that request. Please try again.