diff --git a/zone/client.cpp b/zone/client.cpp index bdc89e3b9..7cfdf512f 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -155,7 +155,8 @@ Client::Client(EQStreamInterface* ieqs) m_Proximity(FLT_MAX, FLT_MAX, FLT_MAX), //arbitrary large number m_ZoneSummonLocation(-2.0f,-2.0f,-2.0f), m_AutoAttackPosition(0.0f, 0.0f, 0.0f, 0.0f), - m_AutoAttackTargetLocation(0.0f, 0.0f, 0.0f) + m_AutoAttackTargetLocation(0.0f, 0.0f, 0.0f), + m_lastsave(-1) { for(int cf=0; cf < _FilterCount; cf++) ClientFilters[cf] = FilterShow; @@ -569,6 +570,10 @@ bool Client::Save(uint8 iCommitNow) { if(!ClientDataLoaded()) return false; + // saved less than 2 seconds ago, lets just skip for now + if ((time(nullptr) - m_lastsave) < 2) + return true; + /* Wrote current basics to PP for saves */ m_pp.x = m_Position.x; m_pp.y = m_Position.y; @@ -658,6 +663,7 @@ bool Client::Save(uint8 iCommitNow) { database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */ + m_lastsave = time(nullptr); return true; } diff --git a/zone/client.h b/zone/client.h index 32d0e176c..e7b7b50b9 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1458,6 +1458,9 @@ private: Timer helm_toggle_timer; Timer light_update_timer; + + time_t m_lastsave; + glm::vec3 m_Proximity; void BulkSendInventoryItems();