diff options
author | Einar Johan Trøan Sømåen | 2013-04-20 18:32:42 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-04-20 18:32:42 +0200 |
commit | f1c38696699240136a6340a6a6be4d2647da8676 (patch) | |
tree | da70fea698716b680fc74d36ae947405cccb0b80 /engines/wintermute/base | |
parent | d8eff7be22078376b377002789556d1828896aa1 (diff) | |
download | scummvm-rg350-f1c38696699240136a6340a6a6be4d2647da8676.tar.gz scummvm-rg350-f1c38696699240136a6340a6a6be4d2647da8676.tar.bz2 scummvm-rg350-f1c38696699240136a6340a6a6be4d2647da8676.zip |
WINTERMUTE: Fix ScriptExtDate-saving (bump savegame-version to 1.2.1).
This also fixes int->int32 in ScriptExtDate::transfer.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/scriptables/script_ext_date.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_date.cpp b/engines/wintermute/base/scriptables/script_ext_date.cpp index 53a1d36b81..afca0c4bbf 100644 --- a/engines/wintermute/base/scriptables/script_ext_date.cpp +++ b/engines/wintermute/base/scriptables/script_ext_date.cpp @@ -237,12 +237,29 @@ bool SXDate::scSetProperty(const char *name, ScValue *value) { bool SXDate::persist(BasePersistenceManager *persistMgr) { BaseScriptable::persist(persistMgr); - persistMgr->transfer(TMEMBER(_tm.tm_year)); - persistMgr->transfer(TMEMBER(_tm.tm_mon)); - persistMgr->transfer(TMEMBER(_tm.tm_mday)); - persistMgr->transfer(TMEMBER(_tm.tm_hour)); - persistMgr->transfer(TMEMBER(_tm.tm_min)); - persistMgr->transfer(TMEMBER(_tm.tm_sec)); + int32 year = _tm.tm_year; + int32 mon = _tm.tm_mon; + int32 mday = _tm.tm_mday; + int32 hour = _tm.tm_hour; + int32 min = _tm.tm_min; + int32 sec = _tm.tm_sec; + persistMgr->transfer(TMEMBER(year)); + persistMgr->transfer(TMEMBER(mon)); + persistMgr->transfer(TMEMBER(mday)); + persistMgr->transfer(TMEMBER(hour)); + persistMgr->transfer(TMEMBER(min)); + persistMgr->transfer(TMEMBER(sec)); + if (persistMgr->checkVersion(1, 2, 1)) { + int32 wday = _tm.tm_wday; + persistMgr->transfer(TMEMBER(wday)); + _tm.tm_wday = wday; + } + _tm.tm_year = year; + _tm.tm_mon = mon; + _tm.tm_mday = mday; + _tm.tm_hour = hour; + _tm.tm_min = min; + _tm.tm_sec = sec; return STATUS_OK; } |