Player: Saving fixes

Address issue of allowing a character to be saved before they were ready for updates.
This commit is contained in:
EmosewaMC 2023-12-04 11:22:43 -08:00
parent 3d85f6639e
commit 6a4f310d89

View File

@ -314,6 +314,11 @@ void Character::SaveXMLToDatabase() {
return; return;
} }
if (!m_OurEntity->GetPlayerReadyForUpdates()) {
LOG("Attempted to save before player %i:%s was not ready for updates. Character will NOT be saved.", GetID(), GetName().c_str());
return;
}
m_OurEntity->UpdateXMLDoc(m_Doc); m_OurEntity->UpdateXMLDoc(m_Doc);
WriteToDatabase(); WriteToDatabase();