mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
SAFE restart
This commit is contained in:
parent
e5f9c90370
commit
05cb95edec
1 changed files with 6 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
|||
using namespace geode::prelude;
|
||||
|
||||
#include <Geode/loader/Dirs.hpp>
|
||||
#include <Geode/binding/AppDelegate.hpp>
|
||||
#include "nfdwin.hpp"
|
||||
#include <filesystem>
|
||||
#include <Windows.h>
|
||||
|
@ -234,13 +235,11 @@ void geode::utils::game::exit() {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (CCApplication::sharedApplication())
|
||||
// please forgive me..
|
||||
// manually set the closed flag
|
||||
// TODO: actually call glfwSetWindowShouldClose
|
||||
*reinterpret_cast<bool*>(reinterpret_cast<uintptr_t>(CCEGLView::sharedOpenGLView()->getWindow()) + 0xa) = true;
|
||||
else
|
||||
std::exit(0);
|
||||
// If this breaks down the read, uhhh blame Cvolton or something
|
||||
if (AppDelegate::get()) {
|
||||
AppDelegate::get()->trySaveGame(true);
|
||||
}
|
||||
std::exit(0);
|
||||
}
|
||||
|
||||
void geode::utils::game::restart() {
|
||||
|
|
Loading…
Reference in a new issue