From 7fc1eb1054a20af97db52bb33323f497951f2ce3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 24 Jan 2025 18:40:25 +0100 Subject: Core/Objects: Removed type casts before accessing WorldObject::m_Events that became unneccessary after moving it from Unit to WorldObject (cherry picked from commit bc8874f30597a996eb30b7b278bcc71b2f082f10) --- .../scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp index 460572978d5..77160ec7e4f 100644 --- a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp +++ b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp @@ -243,13 +243,13 @@ class spell_ioc_parachute_ic : public AuraScript class StartLaunchEvent : public BasicEvent { public: - StartLaunchEvent(Position const& pos, ObjectGuid const& guid) : _pos(pos), _guid(guid) + StartLaunchEvent(Map const* map, Position const& pos, ObjectGuid const& guid) : _map(map), _pos(pos), _guid(guid) { } bool Execute(uint64 /*time*/, uint32 /*diff*/) override { - Player* player = ObjectAccessor::FindPlayer(_guid); + Player* player = ObjectAccessor::GetPlayer(_map, _guid); if (!player || !player->GetVehicle()) return true; @@ -263,6 +263,7 @@ class StartLaunchEvent : public BasicEvent } private: + Map const* _map; Position _pos; ObjectGuid _guid; }; @@ -272,10 +273,10 @@ class spell_ioc_launch : public SpellScript { void Launch() { - if (!GetCaster()->ToCreature() || !GetExplTargetDest()) + if (!GetCaster()->IsCreature() || !GetExplTargetDest()) return; - GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), ASSERT_NOTNULL(GetHitPlayer())->GetGUID()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms)); + GetCaster()->m_Events.AddEventAtOffset(new StartLaunchEvent(GetCaster()->GetMap(), *GetExplTargetDest(), GetHitUnit()->GetGUID()), 2500ms); } void Register() override -- cgit v1.2.3