Get rid of the std exception.

develop
Alexander Gavrilov 2013-11-07 11:58:11 +04:00
parent b2819ea869
commit 7ce5831257
1 changed files with 3 additions and 2 deletions

@ -1,4 +1,5 @@
#include "Core.h"
#include "Error.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
@ -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<EventManager::EventType::EventType>(evType);