]> git.lizzy.rs Git - minetest.git/blobdiff - src/environment.cpp
Copy zlib and freetype dll to windows package too
[minetest.git] / src / environment.cpp
index d068aa788a43100ae433ae69e8b59a13336ccac4..24a498aa96b6c51414e16604458b4492ff9140a6 100644 (file)
@@ -455,13 +455,14 @@ Player *ServerEnvironment::loadPlayer(const std::string &playername)
 
        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;