From 862a46d5ddcbf9ce263afc72e3dbbfa2b1d3ab1b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 22 Oct 2013 06:00:00 +0200 Subject: Avalanche: Replace some British English by American English pointed by clone2727 --- engines/avalanche/avalot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 8ef41a2c93..a7108841d4 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1448,8 +1448,8 @@ void AvalancheEngine::resetVariables() { _standingOnDais = false; _takenPen = false; _arrowInTheDoor = false; - _favouriteDrink = ""; - _favouriteSong = ""; + _favoriteDrink = ""; + _favoriteSong = ""; _worstPlaceOnEarth = ""; _spareEvening = ""; _totalTime = 0; @@ -1502,7 +1502,7 @@ void AvalancheEngine::newGame() { _dialogs->setBubbleStateNatural(); _spareEvening = "answer a questionnaire"; - _favouriteDrink = "beer"; + _favoriteDrink = "beer"; _money = 30; // 2/6 _animation->setDirection(kDirStopped); _parser->_wearing = kObjectClothes; -- cgit v1.2.3 From 0b4baa6873ae9a8249b8ce63a19fe0ed0d99f7b0 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 24 Oct 2013 07:56:32 +0200 Subject: AVALANCHE: Fix a couple of (theoretical) out of bounds accesses (CID 1109650) --- engines/avalanche/avalot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index a7108841d4..072ad00ed6 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1229,7 +1229,7 @@ void AvalancheEngine::checkClick() { _parser->_thing += 49; _parser->_person = kPeoplePardon; } else { - _parser->_person = (People) _thinks; + _parser->_person = (People)_thinks; _parser->_thing = _parser->kPardon; } callVerb(kVerbCodeExam); -- cgit v1.2.3 From 334e429c0ac0052f11b04e120734aae772e83074 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 25 Oct 2013 07:48:46 +0200 Subject: AVALANCHE: Fix several other out of bounds access - CID 1109650 --- engines/avalanche/avalot.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 072ad00ed6..11729ea779 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1564,10 +1564,12 @@ Common::String AvalancheEngine::getName(People whose) { static const char lasses[4][15] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"}; - if (whose < kPeopleArkata) + if (whose <= kPeopleJacques) return Common::String(lads[whose - kPeopleAvalot]); - else + else if ((whose >= kPeopleArkata) && (whose <= kPeopleWisewoman)) return Common::String(lasses[whose - kPeopleArkata]); + else + error("getName() - Unexpected character id %d", (byte) whose); } Common::String AvalancheEngine::getItem(byte which) { -- cgit v1.2.3 From 8677f9aa3c689364fd1ca546520e07e65d742d71 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 25 Oct 2013 07:58:15 +0200 Subject: AVALANCHE: Fix one more out of bounds - CID 1109651 --- engines/avalanche/avalot.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 11729ea779..9d65ed7484 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1676,6 +1676,9 @@ void AvalancheEngine::flipRoom(Room room, byte ped) { if (_room == kRoomLustiesRoom) _enterCatacombsFromLustiesRoom = true; + if (_room > kRoomMap) + return; + enterRoom(room, ped); _animation->appearPed(0, ped - 1); _enterCatacombsFromLustiesRoom = false; -- cgit v1.2.3 From 7dc1ea9ada597146b96ee1bf4c26a105767d30e1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 25 Oct 2013 08:10:38 +0200 Subject: AVALANCHE: Fix out of bounds reads (CID 1109653-1109655) --- engines/avalanche/avalot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 9d65ed7484..b1bbf4ff09 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1676,7 +1676,7 @@ void AvalancheEngine::flipRoom(Room room, byte ped) { if (_room == kRoomLustiesRoom) _enterCatacombsFromLustiesRoom = true; - if (_room > kRoomMap) + if (room > kRoomMap) return; enterRoom(room, ped); -- cgit v1.2.3 From 5653a89e81d600b2388831cfe05c36d3068813b5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 28 Oct 2013 07:49:05 +0100 Subject: AVALANCHE: Fix CID 1109696, 1109697 --- engines/avalanche/avalot.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/avalanche/avalot.cpp') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index b1bbf4ff09..36ce16d09c 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -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; -- cgit v1.2.3