Update talkspeed config setting, when set by game scripts

svn-id: r22854
This commit is contained in:
Travis Howell 2006-06-03 04:10:14 +00:00
parent 93a91f9c6d
commit fc26d9b413
2 changed files with 8 additions and 9 deletions

View file

@ -618,15 +618,15 @@ void ScummEngine::writeVar(uint var, int value) {
if (var == VAR_CHARINC) { if (var == VAR_CHARINC) {
if (ConfMan.hasKey("talkspeed")) { if (ConfMan.hasKey("talkspeed")) {
VAR(VAR_CHARINC) = getTalkspeed(); value = getTalkspeed();
} else { } else {
// Save the new talkspeed value to ConfMan // 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 ((_varwatch == (int)var) || (_varwatch == 0)) {
if (vm.slot[_currentScript].number < 100) if (vm.slot[_currentScript].number < 100)
debug(1, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); debug(1, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number);

View file

@ -421,16 +421,15 @@ void ScummEngine_v8::writeVar(uint var, int value) {
if (var == VAR_CHARINC) { if (var == VAR_CHARINC) {
if (ConfMan.hasKey("talkspeed")) { if (ConfMan.hasKey("talkspeed")) {
_defaultTalkDelay = getTalkspeed(); value = getTalkspeed();
VAR(VAR_CHARINC) = _defaultTalkDelay;
} else { } else {
// Save the new talkspeed value to ConfMan // 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 ((_varwatch == (int)var) || (_varwatch == 0)) {
if (vm.slot[_currentScript].number < 100) if (vm.slot[_currentScript].number < 100)
debugC(DEBUG_VARS, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number); debugC(DEBUG_VARS, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number);