diff options
author | Eugene Sandulenko | 2016-01-31 16:13:34 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:57 +0100 |
commit | 12f02969beb3b16f1f9f7b887a622ff5ff018dfc (patch) | |
tree | 2e6d5ae6df8bf39140ee3c9e603029474cda17df /engines/wage | |
parent | efc7bf645161a16799a6608a954ab518fa8d78b8 (diff) | |
download | scummvm-rg350-12f02969beb3b16f1f9f7b887a622ff5ff018dfc.tar.gz scummvm-rg350-12f02969beb3b16f1f9f7b887a622ff5ff018dfc.tar.bz2 scummvm-rg350-12f02969beb3b16f1f9f7b887a622ff5ff018dfc.zip |
WAGE: Fix crashes during direction change
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/combat.cpp | 3 | ||||
-rw-r--r-- | engines/wage/wage.cpp | 7 |
2 files changed, 1 insertions, 9 deletions
diff --git a/engines/wage/combat.cpp b/engines/wage/combat.cpp index 50b6e1ddd7..576229f706 100644 --- a/engines/wage/combat.cpp +++ b/engines/wage/combat.cpp @@ -409,10 +409,9 @@ void WageEngine::performMove(Chr *chr, int validMoves) { int dir = _rnd->getRandomNumber(numValidMoves); // And get it - for (int i = 0; i < 4; i++, dir--) if ((validMoves & (1 << i)) != 0) { - if (dir == 0) { + if (dir == 1) { dir = i; break; } diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 103be5de79..48f3c8078c 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -336,13 +336,6 @@ void WageEngine::onMove(Designed *what, Designed *from, Designed *to) { return; } - if (!_temporarilyHidden) { - assert(what); - assert(from); - assert(to); - debug(6, "move: %s, %s -> %s", what->_name.c_str(), from->_name.c_str(), to->_name.c_str()); - } - if (from == currentScene || to == currentScene || (what->_classType == CHR && ((Chr *)what)->_currentScene == currentScene) || (what->_classType == OBJ && ((Obj *)what)->_currentScene == currentScene)) |