aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/griffon/combat.cpp4
-rw-r--r--engines/griffon/engine.cpp7
-rw-r--r--engines/griffon/griffon.cpp3
3 files changed, 9 insertions, 5 deletions
diff --git a/engines/griffon/combat.cpp b/engines/griffon/combat.cpp
index 59814ef504..2daafd20e0 100644
--- a/engines/griffon/combat.cpp
+++ b/engines/griffon/combat.cpp
@@ -1000,8 +1000,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcInfo[npcnum].script == kScriptEndOfGame)
+ if (_npcInfo[npcnum].script == kScriptEndOfGame) {
+ endOfGame();
_gameEnd = true;
+ }
}
}
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp
index c90b9a05cd..291076cdaa 100644
--- a/engines/griffon/engine.cpp
+++ b/engines/griffon/engine.cpp
@@ -212,9 +212,14 @@ void GriffonEngine::updateEngine() {
while (_itemyloc >= 16)
_itemyloc -= 16;
- if (_player.hp <= 0)
+ if (_player.hp <= 0) {
theEnd();
+ _gameEnd = true;
+
+ return;
+ }
+
if (_roomLock) {
_roomLock = false;
for (int i = 1; i <= _lastNpc; i++)
diff --git a/engines/griffon/griffon.cpp b/engines/griffon/griffon.cpp
index 0263f891df..dd9596945f 100644
--- a/engines/griffon/griffon.cpp
+++ b/engines/griffon/griffon.cpp
@@ -125,9 +125,6 @@ Common::Error GriffonEngine::run() {
if (!_shouldQuit && !_gameEnd)
saveLoadNew();
-
- if (_gameEnd)
- endOfGame();
}
return Common::kNoError;