mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-09 03:18:57 +01:00
Core/Vehicles: cast Parachute spell when player leaves a flying vehicle via opcode (#227)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "WorldSession.h"
|
||||
#include "Creature.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
@@ -208,7 +209,12 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
|
||||
if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(GetPlayer()))
|
||||
{
|
||||
if (seat->CanEnterOrExit())
|
||||
{
|
||||
GetPlayer()->ExitVehicle();
|
||||
if (Creature* creature = vehicle->GetBase()->ToCreature())
|
||||
if (creature->IsFlying())
|
||||
GetPlayer()->CastSpell(GetPlayer(), VEHICLE_SPELL_PARACHUTE);
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("network", "Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
|
||||
GetPlayer()->GetGUID().GetCounter(), seat->ID, seat->Flags);
|
||||
|
||||
Reference in New Issue
Block a user