Fixed data loss at player save.
--HG-- branch : trunk
This commit is contained in:
@@ -287,6 +287,8 @@ UpdateMask Player::updateVisualBits;
|
|||||||
|
|
||||||
Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputationMgr(this)
|
Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputationMgr(this)
|
||||||
{
|
{
|
||||||
|
m_isSaved = false;
|
||||||
|
|
||||||
m_speakTime = 0;
|
m_speakTime = 0;
|
||||||
m_speakCount = 0;
|
m_speakCount = 0;
|
||||||
|
|
||||||
@@ -16987,12 +16989,15 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result)
|
|||||||
void Player::SaveToDB()
|
void Player::SaveToDB()
|
||||||
{
|
{
|
||||||
// delay auto save at any saves (manual, in code, or autosave)
|
// delay auto save at any saves (manual, in code, or autosave)
|
||||||
|
m_isSaved = true;
|
||||||
|
|
||||||
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||||
|
|
||||||
//lets allow only players in world to be saved
|
//lets allow only players in world to be saved
|
||||||
if (IsBeingTeleportedFar())
|
if (IsBeingTeleportedFar())
|
||||||
{
|
{
|
||||||
ScheduleDelayedOperation(DELAYED_SAVE_PLAYER);
|
ScheduleDelayedOperation(DELAYED_SAVE_PLAYER);
|
||||||
|
m_isSaved = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17126,6 +17131,7 @@ void Player::SaveToDB()
|
|||||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||||
if (Pet* pet = GetPet())
|
if (Pet* pet = GetPet())
|
||||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||||
|
m_isSaved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fast save function for item/money cheating preventing - save only inventory and money state
|
// fast save function for item/money cheating preventing - save only inventory and money state
|
||||||
|
|||||||
@@ -2577,6 +2577,8 @@ Spell * m_spellModTakingSpell;
|
|||||||
|
|
||||||
uint32 m_ChampioningFaction;
|
uint32 m_ChampioningFaction;
|
||||||
|
|
||||||
|
bool m_isSaved;
|
||||||
|
|
||||||
uint32 m_timeSyncCount;
|
uint32 m_timeSyncCount;
|
||||||
uint32 m_timeSyncTimer;
|
uint32 m_timeSyncTimer;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user