From 4b81c807c8432e48be64d971a4b6cc932bb9c109 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 14 Feb 2016 09:44:03 +0100 Subject: MOHAWK: Issue a warning when trying to pop with no card pushed --- engines/mohawk/myst_scripts.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mohawk/myst_scripts.cpp') diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index a935ef5e5f..0e14b24ed3 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -509,6 +509,11 @@ void MystScriptParser::o_changeCardPop(uint16 op, uint16 var, uint16 argc, uint1 debugC(kDebugScript, "Opcode %d: Return To Stored Card Id", op); debugC(kDebugScript, "\tCardId: %d", _savedCardId); + if (_savedCardId == 0) { + warning("No pushed card to go back to"); + return; + } + TransitionType transition = static_cast(argv[0]); _vm->changeToCard(_savedCardId, transition); -- cgit v1.2.3