From d45d4ed0de4b9c0964db38b3954953fc891e482d Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 6 Aug 2020 13:38:28 +0200 Subject: [PATCH] Core/Misc: apply missile canceling codestyle changes based on master branch feedback --- src/common/Utilities/EventProcessor.h | 6 ++---- src/server/game/Entities/Unit/Unit.cpp | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h index 3b9453ed203..dd18f65dabe 100644 --- a/src/common/Utilities/EventProcessor.h +++ b/src/common/Utilities/EventProcessor.h @@ -70,8 +70,6 @@ class TC_COMMON_API BasicEvent uint64 m_execTime; // planned time of next execution, filled by event handler }; -typedef std::multimap EventList; - template class LambdaBasicEvent : public BasicEvent { @@ -111,11 +109,11 @@ class TC_COMMON_API EventProcessor is_lambda_event AddEventAtOffset(T&& event, Milliseconds offset, Milliseconds offset2) { AddEventAtOffset(new LambdaBasicEvent(std::move(event)), offset, offset2); } void ModifyEventTime(BasicEvent* event, uint64 newTime); uint64 CalculateTime(uint64 t_offset) const { return m_time + t_offset; } - EventList& GetEventList() { return m_events; } + std::multimap& GetEvents() { return m_events; } protected: uint64 m_time; - EventList m_events; + std::multimap m_events; }; #endif diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index beec1a9611a..979282c84f2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12517,10 +12517,8 @@ void Unit::SendPlaySpellVisualKit(uint32 id, uint32 type, uint32 duration) const void Unit::CancelSpellMissiles(uint32 spellId, bool reverseMissile /*= false*/) { - EventList& eventList = m_Events.GetEventList(); bool hasMissile = false; - - for (auto itr : eventList) + for (auto itr : m_Events.GetEvents()) { if (Spell const* spell = Spell::ExtractSpellFromEvent(itr.second)) {