]> git.localhorst.tv Git - blank.git/blobdiff - src/app/WorldState.cpp
try to get every chunk change saved to disk
[blank.git] / src / app / WorldState.cpp
index 12e142ac5a4cfe086f50e084d725162144a464d3..86e3eac93bdaa619fd344d7709f92b6ff4a65421 100644 (file)
@@ -1,6 +1,7 @@
 #include "WorldState.hpp"
 
 #include "Environment.hpp"
+#include "UnloadState.hpp"
 
 #include <SDL.h>
 
@@ -41,6 +42,10 @@ void WorldState::Handle(const SDL_Event &event) {
                case SDL_MOUSEWHEEL:
                        interface.Handle(event.wheel);
                        break;
+               case SDL_QUIT:
+                       // don't care about this leak just now
+                       env.state.Switch(new UnloadState(env, world.Loader()));
+                       break;
                default:
                        break;
        }