From 7e2819c62e8721020ba5459d8a8177e44a36a560 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 28 Nov 2013 09:27:10 +0100 Subject: [PATCH] store year in saved game profile --- apps/openmw/mwbase/world.hpp | 1 + apps/openmw/mwstate/statemanagerimp.cpp | 2 +- apps/openmw/mwworld/worldimp.cpp | 5 +++++ apps/openmw/mwworld/worldimp.hpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 41cacd365..87a9b5bbc 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -196,6 +196,7 @@ namespace MWBase virtual int getDay() const = 0; virtual int getMonth() const = 0; + virtual int getYear() const = 0; virtual std::string getMonthName (int month = -1) const = 0; ///< Return name of month (-1: current month) diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 8faab1609..60b19fd46 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -82,7 +82,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot profile.mInGameTime.mGameHour = world.getTimeStamp().getHour(); profile.mInGameTime.mDay = world.getDay(); profile.mInGameTime.mMonth = world.getMonth(); - /// \todo year + profile.mInGameTime.mYear = world.getYear(); /// \todo time played profile.mDescription = description; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 0767718b8..1e7b8122f 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -705,6 +705,11 @@ namespace MWWorld return mGlobalVariables->getInt("month"); } + int World::getYear() const + { + return mGlobalVariables->getInt("year"); + } + std::string World::getMonthName (int month) const { if (month==-1) diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index eda79b433..2b7d157ff 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -261,6 +261,7 @@ namespace MWWorld virtual int getDay() const; virtual int getMonth() const; + virtual int getYear() const; virtual std::string getMonthName (int month = -1) const; ///< Return name of month (-1: current month)