aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-09-22 12:13:15 +0000
committerTravis Howell2004-09-22 12:13:15 +0000
commit4871a2af1950da3e0012713d8b04762227ca06a2 (patch)
tree5e20990c41df1f09e3235d64888a367b1e26c6d4 /scumm
parent8950f786990fc4677537061ca9cfffad05f97ddc (diff)
downloadscummvm-rg350-4871a2af1950da3e0012713d8b04762227ca06a2.tar.gz
scummvm-rg350-4871a2af1950da3e0012713d8b04762227ca06a2.tar.bz2
scummvm-rg350-4871a2af1950da3e0012713d8b04762227ca06a2.zip
Debug values are shown correctly now.
svn-id: r15235
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v72he.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 5e66341317..1003130aa7 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -558,13 +558,13 @@ void ScummEngine_v72he::copyScriptString(byte *dst) {
void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) {
int args[31];
- int num = 0, val = 0;
- int len;
+ int num = 0, val;
+ int len, id;
byte chr, string[256];
memset(string, 0, sizeof(string));
- getStackList(args, ARRAYSIZE(args));
- int id = pop();
+ val = getStackList(args, ARRAYSIZE(args));
+ args[val] = id = pop();
if (scriptString) {
addMessageToStack(_scriptPointer, string, sizeof(string));
@@ -580,7 +580,7 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) {
if (chr == '%') {
chr = string[num++];
if (chr == 'd') {
- dst += snprintf((char *)dst, 10, "%d", args[val++]);
+ dst += snprintf((char *)dst, 10, "%d", args[val--]);
continue;
} else if (chr == 's') {
dst += addStringToStack(dst, 512, id++);