diff options
author | Eugene Sandulenko | 2016-05-24 10:54:01 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-24 11:07:48 +0200 |
commit | ed5adcbc59bc6a99837c0537f8461b38717728d8 (patch) | |
tree | 714f03f89cd7b208eb31bbf9984be674b6b096cd /engines | |
parent | de59c82b488b9590f4ef9d4e1ccd1d3280890981 (diff) | |
download | scummvm-rg350-ed5adcbc59bc6a99837c0537f8461b38717728d8.tar.gz scummvm-rg350-ed5adcbc59bc6a99837c0537f8461b38717728d8.tar.bz2 scummvm-rg350-ed5adcbc59bc6a99837c0537f8461b38717728d8.zip |
SCUMM HE: Fix bug with parameter initialization, add more debug output
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/he/moonbase/ai_main.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.cpp | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp index 8ed3c48d84..554d2eeb06 100644 --- a/engines/scumm/he/moonbase/ai_main.cpp +++ b/engines/scumm/he/moonbase/ai_main.cpp @@ -2719,6 +2719,8 @@ int getUnitsWithinRadius(int x, int y, int radius) { assert(y >= 0); assert(radius >= 0); + debug(0, "getUnitsWithinRadius(%d, %d, %d)", x, y, radius); + int retVal = _vm->_moonbase->callScummFunction(MCP_params[F_GET_UNITS_WITHIN_RADIUS], 3, x, y, radius); return retVal; } diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp index cc25c270e4..d7069e73d8 100644 --- a/engines/scumm/he/moonbase/moonbase.cpp +++ b/engines/scumm/he/moonbase/moonbase.cpp @@ -43,9 +43,21 @@ int Moonbase::callScummFunction(int scriptNumber, int paramCount,...) { va_start(va_params, paramCount); int args[25]; - for (int i = 0; i < paramCount; i++) + memset(args, 0, sizeof(args)); + + Common::String str; + str = Common::String::format("callScummFunction(%d, [", scriptNumber); + + for (int i = 0; i < paramCount; i++) { args[i] = va_arg(va_params, int); + str += Common::String::format("%d ", args[i]); + } + str += "])"; + + debug(0, "%s", str.c_str()); + + va_end(va_params); _vm->runScript(scriptNumber, 0, 1, args); |