aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-06-25 14:57:17 +0200
committerThierry Crozat2019-07-28 15:09:14 +0100
commit1cf7bd073f629638488b9dfaaffef693aac0caf5 (patch)
tree8dd5d18618df653f144c1249e13afe7c5692e7b9
parent01d601b23775d5db2af45df78eb2dca4cac9a22c (diff)
downloadscummvm-rg350-1cf7bd073f629638488b9dfaaffef693aac0caf5.tar.gz
scummvm-rg350-1cf7bd073f629638488b9dfaaffef693aac0caf5.tar.bz2
scummvm-rg350-1cf7bd073f629638488b9dfaaffef693aac0caf5.zip
SUPERNOVA: Fix segfault in axacuss
-rw-r--r--engines/supernova/supernova1/rooms.cpp10
-rw-r--r--engines/supernova/supernova1/state.cpp1
2 files changed, 7 insertions, 4 deletions
diff --git a/engines/supernova/supernova1/rooms.cpp b/engines/supernova/supernova1/rooms.cpp
index f39cbb861b..5fe0868473 100644
--- a/engines/supernova/supernova1/rooms.cpp
+++ b/engines/supernova/supernova1/rooms.cpp
@@ -3108,8 +3108,9 @@ void AxacussCorridor3::onEntrance() {
void AxacussCorridor4::onEntrance() {
_gm->great(4);
- _gm->corridorOnEntrance();
- if (_gm->_rooms[GUARD]->isSectionVisible(1))
+ if (_gm->_state._corridorSearch)
+ _gm->busted(0);
+ else if (_gm->_rooms[GUARD]->isSectionVisible(1))
_gm->busted(0);
}
@@ -3459,8 +3460,9 @@ AxacussBcorridor::AxacussBcorridor(SupernovaEngine *vm, GameManager1 *gm) {
}
void AxacussBcorridor::onEntrance() {
- _gm->corridorOnEntrance();
- if (isSectionVisible(7))
+ if (_gm->_state._corridorSearch)
+ _gm->busted(0);
+ else if (isSectionVisible(7))
_gm->busted(-1);
}
diff --git a/engines/supernova/supernova1/state.cpp b/engines/supernova/supernova1/state.cpp
index f3f8bbac63..e9c4d34dee 100644
--- a/engines/supernova/supernova1/state.cpp
+++ b/engines/supernova/supernova1/state.cpp
@@ -653,6 +653,7 @@ void GameManager1::busted(int i) {
wait(3);
_vm->renderImage(i + 2);
shot(0, 0);
+ return;
} else if (_currentRoom->getId() == BCORRIDOR)
_vm->renderImage(21);
else if (_currentRoom->isSectionVisible(4))