aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bindings/scripts/include/precompiled.h2
-rw-r--r--src/bindings/scripts/scripts/world/npc_innkeeper.cpp4
-rw-r--r--src/game/GameEventMgr.cpp10
-rw-r--r--src/game/GameEventMgr.h3
4 files changed, 13 insertions, 6 deletions
diff --git a/src/bindings/scripts/include/precompiled.h b/src/bindings/scripts/include/precompiled.h
index c533aade45f..3d8e1a12cc8 100644
--- a/src/bindings/scripts/include/precompiled.h
+++ b/src/bindings/scripts/include/precompiled.h
@@ -8,7 +8,7 @@
#include "../ScriptMgr.h"
#include "Cell.h"
#include "CellImpl.h"
-#include "GameEventMgr.cpp"
+#include "GameEventMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Unit.h"
diff --git a/src/bindings/scripts/scripts/world/npc_innkeeper.cpp b/src/bindings/scripts/scripts/world/npc_innkeeper.cpp
index 43ba02b79df..500356212ff 100644
--- a/src/bindings/scripts/scripts/world/npc_innkeeper.cpp
+++ b/src/bindings/scripts/scripts/world/npc_innkeeper.cpp
@@ -40,7 +40,7 @@ EndScriptData */
bool GossipHello_npc_innkeeper(Player *pPlayer, Creature *pCreature)
{
- if (gameeventmgr.IsActiveEvent(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
+ if (IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
@@ -77,7 +77,7 @@ bool GossipHello_npc_innkeeper(Player *pPlayer, Creature *pCreature)
bool GossipSelect_npc_innkeeper(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
- if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && gameeventmgr.IsActiveEvent(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
pPlayer->CastSpell(pPlayer, SPELL_TRICK_OR_TREATED, true);
diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp
index 640442bf052..3d19b8197cb 100644
--- a/src/game/GameEventMgr.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -1645,14 +1645,20 @@ void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id)
}
}
-TRINITY_DLL_SPEC bool IsHolidayActive( HolidayIds id )
+TRINITY_DLL_SPEC bool IsHolidayActive(HolidayIds id)
{
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
- if(events[*itr].holiday_id==id)
+ if(events[*itr].holiday_id == id)
return true;
return false;
}
+
+TRINITY_DLL_SPEC bool IsEventActive(uint16 event_id)
+{
+ GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
+ return ae.find(event_id) != ae.end();
+}
diff --git a/src/game/GameEventMgr.h b/src/game/GameEventMgr.h
index 89f962a785b..7f5e92b723d 100644
--- a/src/game/GameEventMgr.h
+++ b/src/game/GameEventMgr.h
@@ -103,7 +103,7 @@ class GameEventMgr
uint32 NextCheck(uint16 entry) const;
void LoadFromDB();
uint32 Update();
- bool IsActiveEvent(uint16 event_id) { return ( m_ActiveEvents.find(event_id)!=m_ActiveEvents.end()); }
+ bool IsActiveEvent(uint16 event_id) { return ( m_ActiveEvents.find(event_id) != m_ActiveEvents.end()); }
uint32 Initialize();
void StartInternalEvent(uint16 event_id);
bool StartEvent(uint16 event_id, bool overwrite = false);
@@ -173,6 +173,7 @@ class GameEventMgr
#define gameeventmgr Trinity::Singleton<GameEventMgr>::Instance()
TRINITY_DLL_SPEC bool IsHolidayActive(HolidayIds id);
+TRINITY_DLL_SPEC bool IsEventActive(uint16 event_id);
#endif