mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix world deletion & fix segfault on attempt to reset content when world is open
This commit is contained in:
parent
010ed78aba
commit
e0440b263e
2 changed files with 5 additions and 1 deletions
|
|
@ -34,9 +34,10 @@ EngineController::EngineController(Engine& engine) : engine(engine) {
|
|||
void EngineController::deleteWorld(const std::string& name) {
|
||||
fs::path folder = engine.getPaths().getWorldFolderByName(name);
|
||||
|
||||
auto deletion = [&]() {
|
||||
auto deletion = [this, folder]() {
|
||||
logger.info() << "deleting " << folder;
|
||||
fs::remove_all(folder);
|
||||
engine.getGUI()->getMenu()->back();
|
||||
};
|
||||
|
||||
if (engine.isHeadless()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue