aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/parallaction/parallaction_ns.cpp5
-rw-r--r--engines/parallaction/parser_ns.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index c2c2f2b0a4..5ec5606845 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -369,6 +369,11 @@ void Parallaction_ns::changeCharacter(const char *name) {
_soundMan->playCharacterMusic(_char.getBaseName());
+ // The original engine used to reload 'common' only on loadgames. We are reloading here since 'common'
+ // contains character specific stuff. This causes crashes like bug #1816899, because parseLocation tries
+ // to reload scripts but the data archive selected is occasionally wrong. This has been solved by having
+ // parseLocation only load scripts when they aren't already loaded - which it should have done since the
+ // beginning nevertheless.
if (!(getFeatures() & GF_DEMO))
parseLocation("common");
}
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index b8b6cf338c..3ce7ce881a 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -988,8 +988,9 @@ void Parallaction_ns::parseLocation(const char *filename) {
// this loads animation scripts
AnimationList::iterator it = _animations.begin();
for ( ; it != _animations.end(); it++) {
- if ((*it)->_scriptName)
+ if (((*it)->_scriptName) && ((*it)->_program == 0)) {
loadProgram(*it, (*it)->_scriptName);
+ }
}
debugC(1, kDebugParser, "parseLocation('%s') done", filename);