diff options
author | Eugene Sandulenko | 2016-05-26 21:22:30 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-26 21:22:30 +0200 |
commit | edb8e6865b972e441cb73ad972df66ee69d1b45a (patch) | |
tree | f438b8b3f76cabe07a82679aa1b616f8fb83182a /engines/scumm/he/moonbase/ai_defenseunit.cpp | |
parent | 2b5ecc4f88a21b673af14849630c598261f3c743 (diff) | |
download | scummvm-rg350-edb8e6865b972e441cb73ad972df66ee69d1b45a.tar.gz scummvm-rg350-edb8e6865b972e441cb73ad972df66ee69d1b45a.tar.bz2 scummvm-rg350-edb8e6865b972e441cb73ad972df66ee69d1b45a.zip |
SCUMM HE: Eliminated global _vm reference in Moonbase AI
Diffstat (limited to 'engines/scumm/he/moonbase/ai_defenseunit.cpp')
-rw-r--r-- | engines/scumm/he/moonbase/ai_defenseunit.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/scumm/he/moonbase/ai_defenseunit.cpp b/engines/scumm/he/moonbase/ai_defenseunit.cpp index ad9792d0b9..37ce303bc5 100644 --- a/engines/scumm/he/moonbase/ai_defenseunit.cpp +++ b/engines/scumm/he/moonbase/ai_defenseunit.cpp @@ -133,13 +133,13 @@ int AntiAirUnit::selectWeapon(int index) { case 2: if (getState() == DUS_OFF) { if (_ai->getPlayerEnergy() > 6) { - if (!_vm->_rnd.getRandomNumber(3)) { + if (!_ai->_vm->_rnd.getRandomNumber(3)) { return ITEM_VIRUS; } } if (_ai->getPlayerEnergy() > 2) { - if (!_vm->_rnd.getRandomNumber(1)) { + if (!_ai->_vm->_rnd.getRandomNumber(1)) { return ITEM_SPIKE; } } @@ -358,19 +358,19 @@ int HubUnit::selectWeapon(int index) { } if (energy > 2) { - if (!_vm->_rnd.getRandomNumber(3)) { + if (!_ai->_vm->_rnd.getRandomNumber(3)) { return ITEM_SPIKE; } - if (!_vm->_rnd.getRandomNumber(4)) { + if (!_ai->_vm->_rnd.getRandomNumber(4)) { return ITEM_GUIDED; } - if (!_vm->_rnd.getRandomNumber(4)) { + if (!_ai->_vm->_rnd.getRandomNumber(4)) { return ITEM_MINE; } - if (!_vm->_rnd.getRandomNumber(9)) { + if (!_ai->_vm->_rnd.getRandomNumber(9)) { return ITEM_EMP; } } @@ -506,7 +506,7 @@ int EnergyUnit::selectWeapon(int index) { } if (energy > 2) { - if (!_vm->_rnd.getRandomNumber(3)) { + if (!_ai->_vm->_rnd.getRandomNumber(3)) { return ITEM_EMP; } } @@ -617,7 +617,7 @@ int CrawlerUnit::selectWeapon(int index) { } if (energy > 2) { - if (_vm->_rnd.getRandomNumber(1)) { + if (_ai->_vm->_rnd.getRandomNumber(1)) { return ITEM_MINE; } else { return ITEM_TIME_EXPIRED; |