mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-06 00:31:43 +00:00
MADS: Add safeguards in DialogsNebular::show
This commit is contained in:
parent
ba330e32be
commit
c0b2d47f38
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user