*Fix build

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-27 23:35:44 -07:00
parent b243cf3228
commit 6f097c724c
4 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
#include "../ScriptMgr.h" #include "../ScriptMgr.h"
#include "Cell.h" #include "Cell.h"
#include "CellImpl.h" #include "CellImpl.h"
#include "GameEventMgr.cpp" #include "GameEventMgr.h"
#include "GridNotifiers.h" #include "GridNotifiers.h"
#include "GridNotifiersImpl.h" #include "GridNotifiersImpl.h"
#include "Unit.h" #include "Unit.h"
@@ -40,7 +40,7 @@ EndScriptData */
bool GossipHello_npc_innkeeper(Player *pPlayer, Creature *pCreature) 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; char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale()) 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) 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); pPlayer->CastSpell(pPlayer, SPELL_TRICK_OR_TREATED, true);
+8 -2
View File
@@ -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::GameEventDataMap const& events = gameeventmgr.GetEventMap();
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList(); GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr) 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 true;
return false; return false;
} }
TRINITY_DLL_SPEC bool IsEventActive(uint16 event_id)
{
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
return ae.find(event_id) != ae.end();
}
+2 -1
View File
@@ -103,7 +103,7 @@ class GameEventMgr
uint32 NextCheck(uint16 entry) const; uint32 NextCheck(uint16 entry) const;
void LoadFromDB(); void LoadFromDB();
uint32 Update(); 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(); uint32 Initialize();
void StartInternalEvent(uint16 event_id); void StartInternalEvent(uint16 event_id);
bool StartEvent(uint16 event_id, bool overwrite = false); bool StartEvent(uint16 event_id, bool overwrite = false);
@@ -173,6 +173,7 @@ class GameEventMgr
#define gameeventmgr Trinity::Singleton<GameEventMgr>::Instance() #define gameeventmgr Trinity::Singleton<GameEventMgr>::Instance()
TRINITY_DLL_SPEC bool IsHolidayActive(HolidayIds id); TRINITY_DLL_SPEC bool IsHolidayActive(HolidayIds id);
TRINITY_DLL_SPEC bool IsEventActive(uint16 event_id);
#endif #endif