From c4f5d262c82ba180d10667a5101f4f009650f369 Mon Sep 17 00:00:00 2001 From: stevenhoefel Date: Wed, 11 Jan 2017 16:50:11 +1100 Subject: DIRECTOR: Further work on TextCast and Button alignment. --- engines/director/score.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'engines/director/score.cpp') diff --git a/engines/director/score.cpp b/engines/director/score.cpp index e525fbad04..3fab9cf011 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -510,16 +510,18 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, debugC(4, kDebugLoading, "'"); CastInfo *ci = new CastInfo(); - - ci->script = castStrings[0]; - ci->name = castStrings[1]; - ci->directory = castStrings[2]; - ci->fileName = castStrings[3]; - ci->type = castStrings[4]; - - if (!ci->script.empty()) { - //the script type here could be wrong! - _lingo->addCode(ci->script.c_str(), kCastScript, id); + + if (castStrings.size() == 5) { + ci->script = castStrings[0]; + ci->name = castStrings[1]; + ci->directory = castStrings[2]; + ci->fileName = castStrings[3]; + ci->type = castStrings[4]; + + if (!ci->script.empty()) { + //the script type here could be wrong! + _lingo->addCode(ci->script.c_str(), kCastScript, id); + } } _castsInfo[id] = ci; -- cgit v1.2.3