diff options
author | Treeston <treeston.mmoc@gmail.com> | 2017-07-25 02:01:32 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-08-20 00:21:37 +0200 |
commit | e69b5d8fcc44728abd189e4832a383543218e5c1 (patch) | |
tree | b93a6ac1283ca363444b6dcfcf93d0f340a1dd97 /src | |
parent | 9757a2992a5127d24e6592540112d7de6cd8c8b6 (diff) |
Scripts/IcecrownCitadel: Prevent players from becoming inaccessible when killed by Lord Marrowgar's Impale spell (the initial damage, not the DoT). Also fix the underlying bug in vehicle logic.
(cherry picked from commit 7cbb6c101e975a046b95aeb5dd68d75d016f67a5)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Vehicle/Vehicle.cpp | 9 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp | 9 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index cfa3adcf555..7e37b5212ae 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -393,7 +393,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ * @author Machiavelli * @date 17-2-2013 * - * @param [in, out] The prospective passenger. + * @param unit The prospective passenger. * @param seatId Identifier for the seat. Value of -1 indicates the next available seat. * * @return true if it succeeds, false if it fails. @@ -766,6 +766,13 @@ bool VehicleJoinEvent::Execute(uint64, uint32) Target->RemovePendingEventsForSeat(Seat->first); Target->RemovePendingEventsForPassenger(Passenger); + // Passenger might've died in the meantime - abort if this is the case + if (!Passenger->IsAlive()) + { + Abort(0); + return true; + } + Passenger->SetVehicle(Target); Seat->second.Passenger.Guid = Passenger->GetGUID(); Seat->second.Passenger.IsUnselectable = Passenger->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 4efe13e02c9..c432352bdea 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -654,6 +654,15 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader { Unit* target = *itr; target->CastSpell(target, BoneSpikeSummonId[i], true); + if (!target->IsAlive()) // make sure we don't get any stuck spikes on dead targets + { + if (Aura* aura = target->GetAura(SPELL_IMPALED)) + { + if (Creature* spike = ObjectAccessor::GetCreature(*target, aura->GetCasterGUID())) + spike->DespawnOrUnsummon(); + aura->Remove(); + } + } } marrowgarAI->Talk(SAY_BONESPIKE); |