summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-10 18:52:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-10 18:52:24 (GMT)
commitfd572e9da68385d13a147164cd07d50160f2fc69 (patch)
tree2cd99a57db8f11f4d41defe4ca4253553cd0b562 /src/game/GameModel.cpp
parentcdc4b4df86d61abf8fe08fe120afcb2393755660 (diff)
downloadpowder-fd572e9da68385d13a147164cd07d50160f2fc69.zip
powder-fd572e9da68385d13a147164cd07d50160f2fc69.tar.gz
Change stamp storage to a list, insert new stamps at the begining, 'l' loads the first stamp or the previously used stamp, 'k' shows the stamp browser
Diffstat (limited to 'src/game/GameModel.cpp')
-rw-r--r--src/game/GameModel.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 36aef35..99a2cc5 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -130,6 +130,15 @@ GameModel::GameModel():
{
currentUser = Client::Ref().GetAuthUser();
}
+
+ //Set stamp to first stamp in list
+ vector<string> stamps = Client::Ref().GetStamps(0, 1);
+ if(stamps.size()>0)
+ {
+ SaveFile * stampFile = Client::Ref().GetStamp(stamps[0]);
+ if(stampFile && stampFile->GetGameSave())
+ stamp = stampFile->GetGameSave();
+ }
}
GameModel::~GameModel()
@@ -430,7 +439,10 @@ void GameModel::SetStamp(GameSave * save)
{
if(stamp)
delete stamp;
- stamp = new GameSave(*save);
+ if(save)
+ stamp = new GameSave(*save);
+ else
+ stamp = NULL;
}
void GameModel::SetPlaceSave(GameSave * save)