aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-07 16:02:19 -0400
committerPaul Gilbert2015-08-07 16:02:19 -0400
commiteadbe2b8b87777ab92234264a4be990be74f03ad (patch)
tree787728807d73efb13a8bb7eb013939449e91020e
parentd6347269eba08d0f7ad717df043a84b95e6836b0 (diff)
downloadscummvm-rg350-eadbe2b8b87777ab92234264a4be990be74f03ad.tar.gz
scummvm-rg350-eadbe2b8b87777ab92234264a4be990be74f03ad.tar.bz2
scummvm-rg350-eadbe2b8b87777ab92234264a4be990be74f03ad.zip
SHERLOCK: RT: Fix crash executing scripts that clear their own data
-rw-r--r--engines/sherlock/talk.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index b347bd458d..83596e4e85 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -339,7 +339,8 @@ void Talk::talkTo(const Common::String &filename) {
_scriptSelect = select;
_speaker = _talkTo;
- Statement &statement = _statements[select];
+ // Make a copy of the statement (in case the script frees the statement list), and then execute it
+ Statement statement = _statements[select];
doScript(_statements[select]._reply);
if (IS_ROSE_TATTOO) {