mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-10 12:09:14 +01:00
Core/Spells: Remade trajectory target selection (#19048)
* Remade trajectory target selection * Added possibility to apply conditions to trajectory spells * Properly recalculate delay time if CMSG_UPDATE_PROJECTILE_POSITION is received
This commit is contained in:
@@ -119,6 +119,20 @@ void EventProcessor::AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime
|
||||
m_events.insert(std::pair<uint64, BasicEvent*>(e_time, Event));
|
||||
}
|
||||
|
||||
void EventProcessor::ModifyEventTime(BasicEvent* Event, uint64 newTime)
|
||||
{
|
||||
for (auto itr = m_events.begin(); itr != m_events.end(); ++itr)
|
||||
{
|
||||
if (itr->second != Event)
|
||||
continue;
|
||||
|
||||
Event->m_execTime = newTime;
|
||||
m_events.erase(itr);
|
||||
m_events.insert(std::pair<uint64, BasicEvent*>(newTime, Event));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 EventProcessor::CalculateTime(uint64 t_offset) const
|
||||
{
|
||||
return(m_time + t_offset);
|
||||
|
||||
@@ -79,6 +79,7 @@ class TC_COMMON_API EventProcessor
|
||||
void Update(uint32 p_time);
|
||||
void KillAllEvents(bool force);
|
||||
void AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime = true);
|
||||
void ModifyEventTime(BasicEvent* Event, uint64 newTime);
|
||||
uint64 CalculateTime(uint64 t_offset) const;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user