aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script_s1.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-06-10 01:16:29 +0000
committerTravis Howell2007-06-10 01:16:29 +0000
commit741aed5047eebc2991bed0e59462d1124b56a3ad (patch)
tree698fe289e19b426a4398f158322fa5c2ef9e38ec /engines/agos/script_s1.cpp
parent574f687c854f2d36b28592658cc488101df62711 (diff)
downloadscummvm-rg350-741aed5047eebc2991bed0e59462d1124b56a3ad.tar.gz
scummvm-rg350-741aed5047eebc2991bed0e59462d1124b56a3ad.tar.bz2
scummvm-rg350-741aed5047eebc2991bed0e59462d1124b56a3ad.zip
Fix crash via assert, when string for subtitles exists, but is only set to zero.
svn-id: r27270
Diffstat (limited to 'engines/agos/script_s1.cpp')
-rw-r--r--engines/agos/script_s1.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index e104013cae..98b31d5c58 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -374,12 +374,12 @@ void AGOSEngine_Simon1::os1_screenTextMsg() {
uint vgaSpriteId = getVarOrByte();
uint color = getVarOrByte();
uint stringId = getNextStringID();
- const byte *string_ptr = NULL;
+ const byte *stringPtr = NULL;
uint speechId = 0;
TextLocation *tl;
if (stringId != 0xFFFF)
- string_ptr = getStringPtrByID(stringId);
+ stringPtr = getStringPtrByID(stringId);
if (getFeatures() & GF_TALKIE) {
if (getGameType() == GType_FF || getGameType() == GType_PP)
@@ -399,8 +399,8 @@ void AGOSEngine_Simon1::os1_screenTextMsg() {
stopAnimateSimon2(2, vgaSpriteId + 2);
}
- if (string_ptr != NULL && (speechId == 0 || _subtitles))
- printScreenText(vgaSpriteId, color, (const char *)string_ptr, tl->x, tl->y, tl->width);
+ if (stringPtr != NULL && stringPtr[0] != 0 && (speechId == 0 || _subtitles))
+ printScreenText(vgaSpriteId, color, (const char *)stringPtr, tl->x, tl->y, tl->width);
}
@@ -450,7 +450,7 @@ void AGOSEngine_Simon1::os1_screenTextPObj() {
}
stringPtr = buf;
}
- if (stringPtr != NULL)
+ if (stringPtr != NULL && stringPtr[0] != 0)
printScreenText(vgaSpriteId, color, stringPtr, tl->x, tl->y, tl->width);
}
}
@@ -512,7 +512,7 @@ void AGOSEngine_Simon1::os1_scnTxtLongText() {
uint speechId = 0;
TextLocation *tl;
- const char *string_ptr = (const char *)getStringPtrByID(_longText[stringId]);
+ const char *stringPtr = (const char *)getStringPtrByID(_longText[stringId]);
if (getFeatures() & GF_TALKIE)
speechId = _longSound[stringId];
@@ -522,8 +522,8 @@ void AGOSEngine_Simon1::os1_scnTxtLongText() {
if (_speech && speechId != 0)
playSpeech(speechId, vgaSpriteId);
- if (string_ptr != NULL && _subtitles)
- printScreenText(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width);
+ if (stringPtr != NULL && stringPtr[0] != 0 && _subtitles)
+ printScreenText(vgaSpriteId, color, stringPtr, tl->x, tl->y, tl->width);
}
void AGOSEngine_Simon1::os1_mouseOn() {