diff --git a/plugins/eventful.cpp b/plugins/eventful.cpp index f93c15edc..97527c0ed 100644 --- a/plugins/eventful.cpp +++ b/plugins/eventful.cpp @@ -1,4 +1,5 @@ #include "Core.h" +#include "Error.h" #include #include #include @@ -228,8 +229,8 @@ static void enableEvent(int evType,int freq) { if (freq < 0) return; - if (evType < 0 || evType >= EventManager::EventType::EVENT_MAX || evType == EventManager::EventType::TICK) - throw std::runtime_error("invalid event type to enable"); + CHECK_INVALID_ARGUMENT(evType >= 0 && evType < EventManager::EventType::EVENT_MAX && + evType != EventManager::EventType::TICK); EventManager::EventHandler::callback_t fun_ptr = eventHandlers[evType]; EventManager::EventType::EventType typeToEnable=static_cast(evType);