[WorldSaveBasicBackend] Now saving game time.

This commit is contained in:
Quentin Bazin 2020-07-17 03:33:58 +02:00
parent 30e3ae2054
commit 49d6d7c0e1

View File

@ -31,6 +31,7 @@
#include <filesystem.hpp>
#include "ComponentType.hpp"
#include "GameTime.hpp"
#include "Network.hpp"
#include "NetworkComponent.hpp"
#include "Registry.hpp"
@ -112,6 +113,10 @@ void WorldSaveBasicBackend::load(const std::string &name) {
auto &player = m_playerList.addPlayer(username, false);
player.deserialize(save);
}
sf::Uint64 ticks;
save >> ticks;
GameTime::setTicks(ticks);
}
// gkInfo() << "Loading done.";
@ -168,6 +173,8 @@ void WorldSaveBasicBackend::save(const std::string &name) {
save << it.second;
}
save << (sf::Uint64)GameTime::getTicks();
file.write((const char *)save.getData(), save.getDataSize());
// gkInfo() << "Saving done.";