aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
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