diff options
author | Strangerke | 2016-05-24 21:41:02 +0200 |
---|---|---|
committer | Strangerke | 2016-05-24 21:41:02 +0200 |
commit | b91d12557f0b458b62d6a971de8be4de114673ac (patch) | |
tree | 08bff8b60d56c1ac74c77389e83c278a7d272e71 | |
parent | 93e0f8f03bc88420bc9f0862a92c72fede0664ab (diff) | |
download | scummvm-rg350-b91d12557f0b458b62d6a971de8be4de114673ac.tar.gz scummvm-rg350-b91d12557f0b458b62d6a971de8be4de114673ac.tar.bz2 scummvm-rg350-b91d12557f0b458b62d6a971de8be4de114673ac.zip |
GNAP: Remove duplicate code in character
-rw-r--r-- | engines/gnap/character.cpp | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/engines/gnap/character.cpp b/engines/gnap/character.cpp index 76e30d9dfa..407ecb1b2b 100644 --- a/engines/gnap/character.cpp +++ b/engines/gnap/character.cpp @@ -430,22 +430,12 @@ int PlayerGnap::getSequenceId(int kind, Common::Point gridPos) { case kGSMoan2: if (gridPos.x > 0 && gridPos.y > 0) { - if (_pos.y > gridPos.y) { - if (_pos.x > gridPos.x) { - sequenceId = 0x832; - _idleFacing = kDirBottomLeft; - } else { - sequenceId = 0x7AA; - _idleFacing = kDirBottomRight; - } + if (_pos.x > gridPos.x) { + sequenceId = 0x832; + _idleFacing = kDirBottomLeft; } else { - if (_pos.x > gridPos.x) { - sequenceId = 0x832; - _idleFacing = kDirBottomLeft; - } else { - sequenceId = 0x7AA; - _idleFacing = kDirBottomRight; - } + sequenceId = 0x7AA; + _idleFacing = kDirBottomRight; } } else if (_idleFacing != kDirBottomRight && _idleFacing != kDirUpRight) { sequenceId = 0x832; @@ -861,17 +851,10 @@ int PlayerGnap::getShowSequenceId(int index, int gridX, int gridY) { Facing facing = _idleFacing; if (gridY > 0 && gridX > 0) { - if (_pos.y > gridY) { - if (_pos.x > gridX) - _idleFacing = kDirUpLeft; - else - _idleFacing = kDirUpRight; - } else { - if (_pos.x > gridX) - _idleFacing = kDirUpLeft; - else - _idleFacing = kDirUpRight; - } + if (_pos.x > gridX) + _idleFacing = kDirUpLeft; + else + _idleFacing = kDirUpRight; } else if (_idleFacing != kDirBottomRight && _idleFacing != kDirUpRight) { _idleFacing = kDirUpLeft; } else { |