[Scummvm-git-logs] scummvm master -> de5e7ba55c351a1ea003efc9bd38ce6a90a6e722
sev-
sev at scummvm.org
Mon Feb 17 22:38:14 UTC 2020
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:
de5e7ba55c DIRECTOR: LINGO: handle break from loops
Commit: de5e7ba55c351a1ea003efc9bd38ce6a90a6e722
https://github.com/scummvm/scummvm/commit/de5e7ba55c351a1ea003efc9bd38ce6a90a6e722
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-02-17T23:38:09+01:00
Commit Message:
DIRECTOR: LINGO: handle break from loops
Lingo has two ways to break from loops: `return` and `exit repeat`.
Both are now handled in repeat with VAR in ARRAY.
Changed paths:
engines/director/lingo/lingo-code.cpp
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 380c78c..58dd67d 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1050,6 +1050,12 @@ void LC::c_repeatwithcode(void) {
for (uint i = 0; i < arraySize; i++) {
g_lingo->varAssign(loop_var, array.u.farr->operator[](i));
g_lingo->execute(body + savepc -1);
+ if (g_lingo->_returning) // handle return within the repeat with loop
+ return;
+ if (g_lingo->_exitRepeat) { // handle `exit repeat`
+ g_lingo->_exitRepeat = false;
+ break;
+ }
}
g_lingo->_pc = end + savepc - 1; /* next stmt */
return;
More information about the Scummvm-git-logs
mailing list