From 49d7d7178d6831cebd2db32cbc254fefb8db07cd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 11 Jul 2021 12:38:29 +0200 Subject: [PATCH] SAGA2: Fix ModalWindow instantiation. CID 1458038 --- engines/saga2/modal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engines/saga2/modal.cpp b/engines/saga2/modal.cpp index b23153b3ba0..557600ad16f 100644 --- a/engines/saga2/modal.cpp +++ b/engines/saga2/modal.cpp @@ -61,10 +61,12 @@ extern void updateWindowSection(const Rect16 &r); ModalWindow *ModalWindow::current = NULL; -ModalWindow::ModalWindow(const Rect16 &r, - uint16 ident, - AppFunc *cmd) - : DecoratedWindow(r, ident, "DialogWindow", cmd) { +ModalWindow::ModalWindow(const Rect16 &r, uint16 ident, AppFunc *cmd) + : DecoratedWindow(r, ident, "DialogWindow", cmd) { + prevModeStackCtr = 0; + + for (int i = 0; i < Max_Modes; i++) + prevModeStackPtr[i] = 0; } ModalWindow::~ModalWindow(void) {