diff options
author | Eugene Sandulenko | 2019-11-06 18:25:25 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-13 22:07:08 +0100 |
commit | dfadc426b74f23d49654b969e7408978aa0d3786 (patch) | |
tree | 2246f47b31ad1317586795785b3445d48e785974 /engines | |
parent | 6409c3804eedf44ca5b6109d9e728c853b148fe4 (diff) | |
download | scummvm-rg350-dfadc426b74f23d49654b969e7408978aa0d3786.tar.gz scummvm-rg350-dfadc426b74f23d49654b969e7408978aa0d3786.tar.bz2 scummvm-rg350-dfadc426b74f23d49654b969e7408978aa0d3786.zip |
GRIFFON: Made theEnd() work properly
Diffstat (limited to 'engines')
-rw-r--r-- | engines/griffon/combat.cpp | 4 | ||||
-rw-r--r-- | engines/griffon/engine.cpp | 7 | ||||
-rw-r--r-- | engines/griffon/griffon.cpp | 3 |
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; |