1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Dont write player files all the time

This commit is contained in:
PilzAdam 2013-06-28 14:06:34 +00:00
parent 9e100bc42b
commit 280946ba83
5 changed files with 71 additions and 1 deletions

View file

@ -434,6 +434,7 @@ void ServerEnvironment::serializePlayers(const std::string &savedir)
//infostream<<"Found matching player, overwriting."<<std::endl;
// OK, found. Save player there.
if(player->checkModified())
{
// Open file and serialize
std::ofstream os(path.c_str(), std::ios_base::binary);
@ -444,6 +445,8 @@ void ServerEnvironment::serializePlayers(const std::string &savedir)
}
player->serialize(os);
saved_players.insert(player);
} else {
saved_players.insert(player);
}
}