diff options
author | Paul Gilbert | 2018-04-03 19:57:03 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-03 19:57:03 -0400 |
commit | 0f82830778c0d45b851b260f3acfcd8f87b5cb3f (patch) | |
tree | bfa8ef24a1178e6a867147e597509238a9f21425 | |
parent | 326533ab9b3d725afd7fec10d852fa0c2261f8a9 (diff) | |
download | scummvm-rg350-0f82830778c0d45b851b260f3acfcd8f87b5cb3f.tar.gz scummvm-rg350-0f82830778c0d45b851b260f3acfcd8f87b5cb3f.tar.bz2 scummvm-rg350-0f82830778c0d45b851b260f3acfcd8f87b5cb3f.zip |
XEEN: Simplify original's code for monsters picking targets
-rw-r--r-- | engines/xeen/combat.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 5f9d7610a7..2bd0187fed 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -861,23 +861,9 @@ void Combat::doMonsterTurn(int monsterId) { if (!isHated) { // No particularly hated foe, so decide which character to start with - switch (_combatParty.size()) { - case 1: - charNum = 0; - break; - case 2: - case 3: - case 4: - case 5: - charNum = _vm->getRandomNumber(0, _combatParty.size() - 1); - break; - case 6: - if (_vm->getRandomNumber(1, 6) == 6) - charNum = 5; - else - charNum = _vm->getRandomNumber(0, 4); - break; - } + // Note: Original had a whole switch statement depending on party size, that boiled down to + // picking a random character in all cases anyway + charNum = _vm->getRandomNumber(0, _combatParty.size() - 1); } // Attacking loop |