diff options
author | Travis Howell | 2006-06-03 04:10:14 +0000 |
---|---|---|
committer | Travis Howell | 2006-06-03 04:10:14 +0000 |
commit | fc26d9b413b6575ccb7be2f77ae2a12f80de0a1e (patch) | |
tree | d5948638e72e144c6a2d4ca4749c4924d84cc34b /engines/scumm | |
parent | 93a91f9c6d7bbbd2247565cced3f9c7c7f6426dd (diff) | |
download | scummvm-rg350-fc26d9b413b6575ccb7be2f77ae2a12f80de0a1e.tar.gz scummvm-rg350-fc26d9b413b6575ccb7be2f77ae2a12f80de0a1e.tar.bz2 scummvm-rg350-fc26d9b413b6575ccb7be2f77ae2a12f80de0a1e.zip |
Update talkspeed config setting, when set by game scripts
svn-id: r22854
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/script.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/script_v8.cpp | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 79f083e05e..ab365e7c87 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -618,15 +618,15 @@ void ScummEngine::writeVar(uint var, int value) { if (var == VAR_CHARINC) { if (ConfMan.hasKey("talkspeed")) { - VAR(VAR_CHARINC) = getTalkspeed(); + value = getTalkspeed(); } else { // Save the new talkspeed value to ConfMan - setTalkspeed(_defaultTalkDelay); + setTalkspeed(value); } - } else { - _scummVars[var] = value; } + _scummVars[var] = value; + if ((_varwatch == (int)var) || (_varwatch == 0)) { if (vm.slot[_currentScript].number < 100) debug(1, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp index 8dae96397d..f9e6e11c30 100644 --- a/engines/scumm/script_v8.cpp +++ b/engines/scumm/script_v8.cpp @@ -421,16 +421,15 @@ void ScummEngine_v8::writeVar(uint var, int value) { if (var == VAR_CHARINC) { if (ConfMan.hasKey("talkspeed")) { - _defaultTalkDelay = getTalkspeed(); - VAR(VAR_CHARINC) = _defaultTalkDelay; + value = getTalkspeed(); } else { // Save the new talkspeed value to ConfMan - setTalkspeed(_defaultTalkDelay); + setTalkspeed(value); } - } else { - _scummVars[var] = value; } + _scummVars[var] = value; + if ((_varwatch == (int)var) || (_varwatch == 0)) { if (vm.slot[_currentScript].number < 100) debugC(DEBUG_VARS, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); |