aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables/script_value.cpp
diff options
context:
space:
mode:
authorStrangerke2013-09-11 21:33:10 +0200
committerStrangerke2013-09-11 21:33:10 +0200
commitda1a427e794434a09cd39ab45e32ae7afca9a170 (patch)
tree85b4700515bc7853e4f90ddae22bc3b785c4ab3a /engines/wintermute/base/scriptables/script_value.cpp
parent49dbac6a2a5cde294a4c4c9a47467e7b5d95e08b (diff)
parent5c6ee7573c0cf05bbbb154d4734e94e478f453e5 (diff)
downloadscummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.gz
scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.bz2
scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.zip
Merge branch 'master' of https://github.com/urukgit/scummvm into avalanche
Diffstat (limited to 'engines/wintermute/base/scriptables/script_value.cpp')
-rw-r--r--engines/wintermute/base/scriptables/script_value.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp
index 3532e127d0..31ec457df1 100644
--- a/engines/wintermute/base/scriptables/script_value.cpp
+++ b/engines/wintermute/base/scriptables/script_value.cpp
@@ -827,6 +827,17 @@ bool ScValue::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferPtr(TMEMBER_PTR(_valRef));
persistMgr->transfer(TMEMBER(_valString));
+ if (!persistMgr->getIsSaving() && !persistMgr->checkVersion(1,2,2)) {
+ // Savegames prior to 1.2.2 stored empty strings as NULL.
+ // We disambiguate those by turning NULL strings into empty
+ // strings if _type is VAL_STRING instead of VAL_NULL.
+
+ if (_type == VAL_STRING && !_valString) {
+ _valString = new char[1];
+ _valString[0] = '\0';
+ }
+ }
+
/* // TODO: Convert to Debug-statements.
FILE* f = fopen("c:\\val.log", "a+");
switch(_type)