mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
[svn] * Avoid access to bag item prototype for getting bag size, use related item update field instead as more fast source.
* Better check client inventory pos data received in some client packets to skip invalid cases. * Removed some unnecessary database queries. * Make guid lookup for adding ignore async. * Added two parameter versions of the AsyncQuery function * Make queries for adding friends async. - Hunuza * Replace some PQuery() calls with more simple Query() - Hunuza * Mark spell as executed instead of deleteable to solve crash. *** Source mangos. **Its a big commit. so test with care... or without care.... whatever floats your boat. --HG-- branch : trunk
This commit is contained in:
@@ -28,7 +28,7 @@ EventProcessor::EventProcessor()
|
||||
|
||||
EventProcessor::~EventProcessor()
|
||||
{
|
||||
KillAllEvents();
|
||||
KillAllEvents(true);
|
||||
}
|
||||
|
||||
void EventProcessor::Update(uint32 p_time)
|
||||
@@ -60,21 +60,31 @@ void EventProcessor::Update(uint32 p_time)
|
||||
}
|
||||
}
|
||||
|
||||
void EventProcessor::KillAllEvents()
|
||||
void EventProcessor::KillAllEvents(bool force)
|
||||
{
|
||||
// prevent event insertions
|
||||
m_aborting = true;
|
||||
|
||||
// first, abort all existing events
|
||||
for (EventList::iterator i = m_events.begin(); i != m_events.end(); ++i)
|
||||
for (EventList::iterator i = m_events.begin(); i != m_events.end();)
|
||||
{
|
||||
i->second->to_Abort = true;
|
||||
i->second->Abort(m_time);
|
||||
delete i->second;
|
||||
EventList::iterator i_old = i;
|
||||
++i;
|
||||
|
||||
i_old->second->to_Abort = true;
|
||||
i_old->second->Abort(m_time);
|
||||
if(force || i_old->second->IsDeletable())
|
||||
{
|
||||
delete i_old->second;
|
||||
|
||||
if(!force) // need per-element cleanup
|
||||
m_events.erase (i_old);
|
||||
}
|
||||
}
|
||||
|
||||
// clear event list
|
||||
m_events.clear();
|
||||
// fast clear event list (in force case)
|
||||
if(force)
|
||||
m_events.clear();
|
||||
}
|
||||
|
||||
void EventProcessor::AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime)
|
||||
|
||||
Reference in New Issue
Block a user