aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/avalot.cpp
diff options
context:
space:
mode:
authorKamil Zbróg2013-11-04 11:40:22 +0000
committerKamil Zbróg2013-11-04 11:40:22 +0000
commit85694ec1f5793eb4025f4153ef4bf71d3769d699 (patch)
treec93fab58eb2f52eca244895a9867d28134dbd7f5 /engines/avalanche/avalot.cpp
parent026390145b0e947be7cccf3d9ba329eb2270a2ed (diff)
parent9dc35033f523c9c694f24e15ed45ba6194786a25 (diff)
downloadscummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.tar.gz
scummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.tar.bz2
scummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.zip
Merge remote-tracking branch 'own/prince' into prince-malik
Conflicts: engines/prince/debugger.cpp engines/prince/debugger.h engines/prince/detection.cpp engines/prince/font.cpp engines/prince/graphics.cpp engines/prince/prince.cpp engines/prince/prince.h engines/prince/script.cpp engines/prince/script.h
Diffstat (limited to 'engines/avalanche/avalot.cpp')
-rw-r--r--engines/avalanche/avalot.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 072ad00ed6..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;
@@ -1564,10 +1569,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) {
@@ -1674,6 +1681,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;