[Scummvm-cvs-logs] scummvm master -> c0b2d47f383984d7f36743b9b8b51fd23e34632a
Strangerke
Strangerke at scummvm.org
Sat Jan 31 12:13:09 CET 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c0b2d47f38 MADS: Add safeguards in DialogsNebular::show
Commit: c0b2d47f383984d7f36743b9b8b51fd23e34632a
https://github.com/scummvm/scummvm/commit/c0b2d47f383984d7f36743b9b8b51fd23e34632a
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-01-31T12:10:55+01:00
Commit Message:
MADS: Add safeguards in DialogsNebular::show
Changed paths:
engines/mads/nebular/dialogs_nebular.cpp
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 74da378..b3d3e06 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -91,6 +91,8 @@ bool DialogsNebular::show(int messageId, int objectId) {
dialog->incNumLines();
}
} else if (commandCheck("ASK", valStr, commandText)) {
+ if (!dialog)
+ error("DialogsNebular::show - Uninitialized dialog");
dialog->addInput();
} else if (commandCheck("VERB", valStr, commandText)) {
dialogText += getVocab(action._activeAction._verbId);
@@ -114,12 +116,18 @@ bool DialogsNebular::show(int messageId, int objectId) {
} else if (commandCheck("WIDTH", valStr, commandText)) {
_dialogWidth = atoi(valStr.c_str());
} else if (commandCheck("BAR", valStr, commandText)) {
+ if (!dialog)
+ error("DialogsNebular::show - Uninitialized dialog");
dialog->addBarLine();
} else if (commandCheck("UNDER", valStr, commandText)) {
underlineFlag = true;
} else if (commandCheck("DOWN", valStr, commandText)) {
+ if (!dialog)
+ error("DialogsNebular::show - Uninitialized dialog");
dialog->downPixelLine();
} else if (commandCheck("TAB", valStr, commandText)) {
+ if (!dialog)
+ error("DialogsNebular::show - Uninitialized dialog");
int xp = atoi(valStr.c_str());
dialog->setLineXp(xp);
}
@@ -164,6 +172,9 @@ bool DialogsNebular::show(int messageId, int objectId) {
if (!centerFlag)
dialog->incNumLines();
+ if (!dialog)
+ error("DialogsNebular::show - Uninitialized dialog");
+
// Show the dialog
_vm->_events->setCursor(CURSOR_ARROW);
dialog->show();
More information about the Scummvm-git-logs
mailing list