aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-07 22:54:16 +0100
committerEugene Sandulenko2017-01-07 22:56:30 +0100
commit8a68c0d8919b0fa08a149312867819e1748bb29f (patch)
tree55a8303ec00ced1f8ea8bbc55e9b7db514ead6bd
parent03638300cff8b091643951241fb8bbd191977ead (diff)
downloadscummvm-rg350-8a68c0d8919b0fa08a149312867819e1748bb29f.tar.gz
scummvm-rg350-8a68c0d8919b0fa08a149312867819e1748bb29f.tar.bz2
scummvm-rg350-8a68c0d8919b0fa08a149312867819e1748bb29f.zip
DIRECTOR: Lingo: Fix arguments check for built-ins
-rw-r--r--engines/director/lingo/lingo-code.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index dd5977673e..c9f9c14e84 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -895,9 +895,10 @@ void Lingo::call(Common::String name, int nargs) {
return;
}
- if (sym->nargs != -1 && sym->nargs < nargs) {
- warning("Incorrect number of arguments for function %s. Dropping extra %d", name.c_str(), nargs - sym->nargs);
- for (int i = 0; i < nargs - sym->nargs; i++)
+ if (sym->nargs != -1 && sym->maxArgs < nargs) {
+ warning("Incorrect number of arguments for function %s (%d, expected %d to %d). Dropping extra %d",
+ name.c_str(), nargs, sym->nargs, sym->maxArgs, nargs - sym->nargs);
+ for (int i = 0; i < nargs - sym->maxArgs; i++)
g_lingo->pop();
}