AVALANCHE: Fix CID 1109696, 1109697

This commit is contained in:
Strangerke 2013-10-28 07:49:05 +01:00
parent a6fbfd958d
commit 5653a89e81
2 changed files with 23 additions and 3 deletions

View File

@ -118,10 +118,13 @@ Room AvalancheEngine::_whereIs[29] = {
Clock::Clock(AvalancheEngine *vm) {
_vm = vm;
// Magic value to determine if we just created the instance
_oldHour = _oldHourAngle = _oldMinute = 17717;
_hour = _minute = _second = 0;
_hourAngle = 0;
}
void Clock::update() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
void Clock::update() {
TimeDate t;
_vm->_system->getTimeAndDate(t);
_hour = t.tm_hour;
@ -177,7 +180,9 @@ void Clock::plotHands() {
}
void Clock::chime() {
if ((_oldHour == 17717) || (!_vm->_soundFx)) // Too high - must be first time around
// Too high - must be first time around
// Mute - skip the sound generation
if ((_oldHour == 17717) || (!_vm->_soundFx))
return;
byte hour = _hour % 12;

View File

@ -37,6 +37,21 @@ const char *Parser::kVersionNum = "1.30";
Parser::Parser(AvalancheEngine *vm) {
_vm = vm;
_verb = kVerbCodePardon;
_thing = kPardon;
_person = kPeopleNone;
_polite = false;
_inputTextPos = 0;
_quote = false;
_cursorState = false;
_weirdWord = false;
_wearing = kNothing;
_thing2 = 0;
_sworeNum = 0;
_alcoholLevel = 0;
_playedNim = 0;
_boughtOnion = false;
}
void Parser::init() {
@ -2457,7 +2472,7 @@ void Parser::doVerb(VerbCode id) {
}
void Parser::resetVariables() {
_wearing = 0;
_wearing = kNothing;
_sworeNum = 0;
_alcoholLevel = 0;
_playedNim = 0;