Make player files saving again

This commit is contained in:
SmallJoker 2014-06-28 17:01:15 +02:00 committed by sapier
parent 897c218b96
commit 3c5df42a17
2 changed files with 2 additions and 0 deletions

View File

@ -462,6 +462,7 @@ Player *ServerEnvironment::loadPlayer(const std::string &playername)
return NULL; return NULL;
} }
testplayer.deSerialize(is, path); testplayer.deSerialize(is, path);
is.close();
if (testplayer.getName() == playername) { if (testplayer.getName() == playername) {
*player = testplayer; *player = testplayer;
found = true; found = true;

View File

@ -314,6 +314,7 @@ void RemotePlayer::save(std::string savedir)
return; return;
} }
testplayer.deSerialize(is, path); testplayer.deSerialize(is, path);
is.close();
if (strcmp(testplayer.getName(), m_name) == 0) { if (strcmp(testplayer.getName(), m_name) == 0) {
// Open file and serialize // Open file and serialize
std::ostringstream ss(std::ios_base::binary); std::ostringstream ss(std::ios_base::binary);