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:
parent
9e100bc42b
commit
280946ba83
5 changed files with 71 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue