diff options
author | n0n4m3 <none@none> | 2010-02-06 19:07:28 +0300 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-02-06 19:07:28 +0300 |
commit | bb7222c376785654ff3256e82fda28f4d8be7e98 (patch) | |
tree | 824e7fa5cc83ab36e305d0a629445234fa016e33 /src | |
parent | 982296518c7886068691010be9d6b094668e1c31 (diff) |
Fixed data loss at player save.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 6 | ||||
-rw-r--r-- | src/game/Player.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 606997908b8..985908dff0a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -287,6 +287,8 @@ UpdateMask Player::updateVisualBits; Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputationMgr(this) { + m_isSaved = false; + m_speakTime = 0; m_speakCount = 0; @@ -16987,12 +16989,15 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result) void Player::SaveToDB() { // delay auto save at any saves (manual, in code, or autosave) + m_isSaved = true; + m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE); //lets allow only players in world to be saved if (IsBeingTeleportedFar()) { ScheduleDelayedOperation(DELAYED_SAVE_PLAYER); + m_isSaved = false; return; } @@ -17126,6 +17131,7 @@ void Player::SaveToDB() // save pet (hunter pet level and experience and all type pets health/mana). if (Pet* pet = GetPet()) pet->SavePetToDB(PET_SAVE_AS_CURRENT); + m_isSaved = false; } // fast save function for item/money cheating preventing - save only inventory and money state diff --git a/src/game/Player.h b/src/game/Player.h index 9d456bf5254..5ea84581735 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2577,6 +2577,8 @@ Spell * m_spellModTakingSpell; uint32 m_ChampioningFaction; + bool m_isSaved; + uint32 m_timeSyncCount; uint32 m_timeSyncTimer; }; |