Skip to content

Commit

Permalink
only ask for saving ghost if the feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stohrendorf committed Dec 19, 2021
1 parent c2af2c4 commit 9188765
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ std::pair<RunResult, std::optional<size_t>> Engine::run(world::World& world, boo
if(!showLevelStats(m_presenter, world))
return {RunResult::ExitApp, std::nullopt};

if(!ghostManager.askGhostSave(*m_presenter, world))
if(m_engineConfig->displaySettings.ghost && !ghostManager.askGhostSave(*m_presenter, world))
return {RunResult::ExitApp, std::nullopt};
}

Expand Down Expand Up @@ -403,21 +403,21 @@ std::pair<RunResult, std::optional<size_t>> Engine::run(world::World& world, boo
case menu::MenuResult::ExitToTitle:
if(allowSave)
{
if(!ghostManager.askGhostSave(*m_presenter, world))
if(m_engineConfig->displaySettings.ghost && !ghostManager.askGhostSave(*m_presenter, world))
return {RunResult::ExitApp, std::nullopt};
}
return {RunResult::TitleLevel, std::nullopt};
case menu::MenuResult::ExitGame:
if(allowSave)
{
if(!ghostManager.askGhostSave(*m_presenter, world))
if(m_engineConfig->displaySettings.ghost && !ghostManager.askGhostSave(*m_presenter, world))
return {RunResult::ExitApp, std::nullopt};
}
return {RunResult::ExitApp, std::nullopt};
case menu::MenuResult::NewGame:
if(allowSave)
{
if(!ghostManager.askGhostSave(*m_presenter, world))
if(m_engineConfig->displaySettings.ghost && !ghostManager.askGhostSave(*m_presenter, world))
return {RunResult::ExitApp, std::nullopt};
}
return {RunResult::NextLevel, std::nullopt};
Expand All @@ -429,7 +429,7 @@ std::pair<RunResult, std::optional<size_t>> Engine::run(world::World& world, boo
{
if(allowSave)
{
if(!ghostManager.askGhostSave(*m_presenter, world))
if(m_engineConfig->displaySettings.ghost && !ghostManager.askGhostSave(*m_presenter, world))
return {RunResult::ExitApp, std::nullopt};
}
return {RunResult::RequestLoad, menu->requestLoad};
Expand Down

0 comments on commit 9188765

Please sign in to comment.