mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 09:56:30 +00:00
XEEN: Move check code for nearby monsters to it's own method
This commit is contained in:
parent
a54850cae0
commit
8648a48080
@ -2087,4 +2087,13 @@ void Combat::shootRangedWeapon() {
|
||||
rangedAttack(POW_ARROW);
|
||||
}
|
||||
|
||||
bool Combat::areMonstersPresent() const {
|
||||
for (int idx = 0; idx < 26; ++idx) {
|
||||
if (_attackMonsters[idx] != -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // End of namespace Xeen
|
||||
|
@ -305,6 +305,11 @@ public:
|
||||
* Fires off a ranged attack at all oncoming monsters
|
||||
*/
|
||||
void shootRangedWeapon();
|
||||
|
||||
/**
|
||||
* Returns true if there are any monsters in the vacinity
|
||||
*/
|
||||
bool areMonstersPresent() const;
|
||||
};
|
||||
|
||||
} // End of namespace Xeen
|
||||
|
@ -689,10 +689,7 @@ void Party::giveTreasure() {
|
||||
if (!_treasure._hasItems && !_treasure._gold && !_treasure._gems)
|
||||
return;
|
||||
|
||||
bool monstersPresent = false;
|
||||
for (int idx = 0; idx < 26 && !monstersPresent; ++idx)
|
||||
monstersPresent = combat._attackMonsters[idx] != -1;
|
||||
|
||||
bool monstersPresent = combat.areMonstersPresent();
|
||||
if (_vm->_mode != MODE_RECORD_EVENTS && monstersPresent)
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user