Core/SAI: Preliminary implementation of SMART_EVENT_GAME_EVENT_START and SMART_EVENT_GAME_EVENT_END {param1: game_event.entry}

This commit is contained in:
Machiavelli committed 2011-12-11 16:23:43 +01:00
1 parent c7ebd0ffa9
commit 1b2c413933
10 files changed
+83 -12

No files matched your search

@@ -26,6 +26,7 @@
#include "CellImpl.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "GameEventMgr.h"
#include "SmartScriptMgr.h"
@@ -466,6 +467,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
return false;
break;
case SMART_EVENT_GAME_EVENT_START:
case SMART_EVENT_GAME_EVENT_END:
{
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
return false;
break;
}
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
case SMART_EVENT_TRANSPORT_RELOCATE: