void MystScriptParser::o_toggleAreasActivation(uint16 var, const ArgumentsArray &args) { uint16 count = args[0]; for (uint16 i = 0; i < count; i++) { MystArea *resource = nullptr; if (args[i + 1] == 0xFFFF) resource = _invokingResource; else resource = _vm->getCard()->getResource<MystArea>(args[i + 1]); if (resource) resource->setEnabled(!resource->isEnabled()); else warning("Unknown Resource in toggleAreasActivation script Opcode"); } }
void MystScriptParser::o_toggleAreasActivation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Toggle areas activation", op); uint16 count = argv[0]; if (argc == count + 1) { for (uint16 i = 0; i < count; i++) { debugC(kDebugScript, "Enable/Disable hotspot index %d", argv[i + 1]); MystArea *resource = nullptr; if (argv[i + 1] == 0xFFFF) resource = _invokingResource; else resource = _vm->_resources[argv[i + 1]]; if (resource) resource->setEnabled(!resource->isEnabled()); else warning("Unknown Resource in toggleAreasActivation script Opcode"); } } else { error("Invalid arguments for opcode %d", op); } }