MOHAWK: Start converting RivenHotspot into a class

This commit is contained in:
Bastien Bouclet 2016-08-05 08:07:02 +02:00 committed by Eugene Sandulenko
parent 1b062d1e39
commit 23bbf05c91
7 changed files with 164 additions and 136 deletions

View file

@ -358,10 +358,10 @@ void RivenSimpleCommand::mohawkSwitch(uint16 op, uint16 argc, uint16 *argv) {
// Command 9: enable hotspot (blst_id)
void RivenSimpleCommand::enableHotspot(uint16 op, uint16 argc, uint16 *argv) {
for (uint16 i = 0; i < _vm->getHotspotCount(); i++) {
if (_vm->_hotspots[i].blstID == argv[0]) {
for (uint16 i = 0; i < _vm->_hotspots.size(); i++) {
if (_vm->_hotspots[i]->blstID == argv[0]) {
debug(2, "Enabling hotspot with BLST ID %d", argv[0]);
_vm->_hotspots[i].enabled = true;
_vm->_hotspots[i]->enabled = true;
}
}
@ -371,10 +371,10 @@ void RivenSimpleCommand::enableHotspot(uint16 op, uint16 argc, uint16 *argv) {
// Command 10: disable hotspot (blst_id)
void RivenSimpleCommand::disableHotspot(uint16 op, uint16 argc, uint16 *argv) {
for (uint16 i = 0; i < _vm->getHotspotCount(); i++) {
if (_vm->_hotspots[i].blstID == argv[0]) {
for (uint16 i = 0; i < _vm->_hotspots.size(); i++) {
if (_vm->_hotspots[i]->blstID == argv[0]) {
debug(2, "Disabling hotspot with BLST ID %d", argv[0]);
_vm->_hotspots[i].enabled = false;
_vm->_hotspots[i]->enabled = false;
}
}
@ -601,9 +601,9 @@ void RivenSimpleCommand::activateBLST(uint16 op, uint16 argc, uint16 *argv) {
uint16 hotspotID = blst->readUint16BE();
if (argv[0] == index)
for (uint16 j = 0; j < _vm->getHotspotCount(); j++)
if (_vm->_hotspots[j].blstID == hotspotID)
_vm->_hotspots[j].enabled = (enabled == 1);
for (uint16 j = 0; j < _vm->_hotspots.size(); j++)
if (_vm->_hotspots[j]->blstID == hotspotID)
_vm->_hotspots[j]->enabled = (enabled == 1);
}
delete blst;