]> git.lizzy.rs Git - minetest.git/blobdiff - src/player.cpp
Add rotation for plantlike drawtype.
[minetest.git] / src / player.cpp
index a52385f20c936e5d08a6d5266d5c8624ea5a881b..40d403952bbbeac0b0c5822d8ef1803212dffc60 100644 (file)
@@ -100,6 +100,7 @@ Player::Player(IGameDef *gamedef):
 
 Player::~Player()
 {
+       clearHud();
 }
 
 // Horizontal acceleration (X and Z), Y direction is ignored
@@ -297,7 +298,7 @@ void RemotePlayer::save(std::string savedir)
 
        savedir += DIR_DELIM;
        std::string path = savedir + m_name;
-       for (u32 i = 0; i < 1000; i++) {
+       for (u32 i = 0; i < PLAYER_FILE_ALTERNATE_TRIES; i++) {
                if (!fs::PathExists(path)) {
                        // Open file and serialize
                        std::ostringstream ss(std::ios_base::binary);
@@ -314,6 +315,7 @@ void RemotePlayer::save(std::string savedir)
                        return;
                }
                testplayer.deSerialize(is, path);
+               is.close();
                if (strcmp(testplayer.getName(), m_name) == 0) {
                        // Open file and serialize
                        std::ostringstream ss(std::ios_base::binary);