summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-12-14 19:44:16 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-12-14 19:44:16 (GMT)
commit31c06669611fa3e4c3db51e1c25c99b466e6743f (patch)
tree0d53b940cc35ba21f796299d3e6576d7c68e7ca4 /src
parente5feefa41920f5bc32f39122c3235976aabcbadd (diff)
downloadpowder-31c06669611fa3e4c3db51e1c25c99b466e6743f.zip
powder-31c06669611fa3e4c3db51e1c25c99b466e6743f.tar.gz
Prevent saves from being loaded twice by the Save browser
Diffstat (limited to 'src')
-rw-r--r--src/game/GameController.cpp1
-rw-r--r--src/search/SearchController.cpp5
-rw-r--r--src/search/SearchController.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 188a233..efaf112 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -40,6 +40,7 @@ public:
try
{
cc->gameModel->SetSave(cc->search->GetLoadedSave());
+ cc->search->ReleaseLoadedSave();
}
catch(GameModelException & ex)
{
diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp
index 7930b65..44ff681 100644
--- a/src/search/SearchController.cpp
+++ b/src/search/SearchController.cpp
@@ -55,6 +55,11 @@ SaveInfo * SearchController::GetLoadedSave()
return searchModel->GetLoadedSave();
}
+void SearchController::ReleaseLoadedSave()
+{
+ searchModel->SetLoadedSave(NULL);
+}
+
void SearchController::Update()
{
if(!nextQueryDone && nextQueryTime < clock())
diff --git a/src/search/SearchController.h b/src/search/SearchController.h
index 66d464a..03967b4 100644
--- a/src/search/SearchController.h
+++ b/src/search/SearchController.h
@@ -44,6 +44,7 @@ public:
void RemoveSelected();
void UnpublishSelected();
void FavouriteSelected();
+ void ReleaseLoadedSave();
SaveInfo * GetLoadedSave();
};