aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-01-24 18:40:25 +0100
committerOvahlord <dreadkiller@gmx.de>2025-01-26 12:48:37 +0100
commit7fc1eb1054a20af97db52bb33323f497951f2ce3 (patch)
tree103d790a753bed29d139a62e1faee48ee84e7fb9 /src/server/scripts
parent32f4c360acebb404d6dd64fca0ea2a7801b678bb (diff)
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)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp9
1 files changed, 5 insertions, 4 deletions
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