aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/script.cpp')
-rw-r--r--engines/sci/engine/script.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 4932c16e73..5191c1a7d8 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -47,7 +47,7 @@ Script::~Script() {
freeScript();
}
-void Script::freeScript() {
+void Script::freeScript(const bool keepLocalsSegment) {
_nr = 0;
_buf.clear();
@@ -59,7 +59,9 @@ void Script::freeScript() {
_numSynonyms = 0;
_localsOffset = 0;
- _localsSegment = 0;
+ if (!keepLocalsSegment) {
+ _localsSegment = 0;
+ }
_localsBlock = NULL;
_localsCount = 0;