RemotePlayer testplayer(m_gamedef);
std::string path = players_path + playername;
- for (u32 i = 0; i < 1000; i++) {
+ for (u32 i = 0; i < PLAYER_FILE_ALTERNATE_TRIES; i++) {
// Open file and deserialize
std::ifstream is(path.c_str(), std::ios_base::binary);
if (!is.good()) {
return NULL;
}
testplayer.deSerialize(is, path);
+ is.close();
if (testplayer.getName() == playername) {
*player = testplayer;
found = true;