From 6490f4caf63b97a4b92a27d4e0bf5ac55beed7a0 Mon Sep 17 00:00:00 2001 From: Xfurry Date: Sat, 30 Dec 2017 19:29:57 +0100 Subject: [PATCH] Update vehicle seat flags Allow seats which have "LowerAnimForEnter" and "LowerAnimForRide" to be used by players or creatures. Basically we assume that any seats with these animations can be used. Also, add some useful comments for other vehicle seat flags Signed-off-by: Xfurry --- src/game/Entities/Vehicle.cpp | 3 ++- src/game/Server/DBCEnums.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/game/Entities/Vehicle.cpp b/src/game/Entities/Vehicle.cpp index 570eca580a5..f274450c768 100644 --- a/src/game/Entities/Vehicle.cpp +++ b/src/game/Entities/Vehicle.cpp @@ -495,7 +495,8 @@ uint8 VehicleInfo::GetTakenSeatsMask() const bool VehicleInfo::IsUsableSeatForPlayer(uint32 seatFlags, uint32 seatFlagsB) const { - return seatFlags & SEAT_FLAG_CAN_EXIT || + return seatFlags & (SEAT_FLAG_HAS_ENTER_ANIM | SEAT_FLAG_HAS_RIDE_ANIM) || + seatFlags & SEAT_FLAG_CAN_EXIT || seatFlags & SEAT_FLAG_UNCONTROLLED || seatFlagsB & (SEAT_FLAG_B_USABLE_FORCED | SEAT_FLAG_B_USABLE_FORCED_2 | diff --git a/src/game/Server/DBCEnums.h b/src/game/Server/DBCEnums.h index 9cf421e1209..d3f21fab323 100644 --- a/src/game/Server/DBCEnums.h +++ b/src/game/Server/DBCEnums.h @@ -502,19 +502,19 @@ enum VehicleFlags enum VehicleSeatFlags { - SEAT_FLAG_UNK1 = 0x00000001, // "HasLowerAnimForEnter" - SEAT_FLAG_UNK2 = 0x00000002, // "HasLowerAnimForRide" + SEAT_FLAG_HAS_ENTER_ANIM = 0x00000001, // "HasLowerAnimForEnter" + SEAT_FLAG_HAS_RIDE_ANIM = 0x00000002, // "HasLowerAnimForRide" SEAT_FLAG_UNK3 = 0x00000004, SEAT_FLAG_UNK4 = 0x00000008, // "ShouldUseVehicleSeatExitAnimationOnVoluntaryExit" SEAT_FLAG_UNK5 = 0x00000010, SEAT_FLAG_UNK6 = 0x00000020, SEAT_FLAG_UNK7 = 0x00000040, SEAT_FLAG_UNK8 = 0x00000080, - SEAT_FLAG_UNK9 = 0x00000100, + SEAT_FLAG_UNK9 = 0x00000100, // Note: only 5 seats are available with this flag in 3.3.5a; found only on flying dragons and harpoon guns SEAT_FLAG_HIDE_PASSENGER = 0x00000200, // Passenger is hidden - SEAT_FLAG_UNK10 = 0x00000400, // "AllowsTurning" + SEAT_FLAG_ALLOW_TURNING = 0x00000400, // "AllowsTurning" | Note: allows the passenger to turn (change orientation) while boarded SEAT_FLAG_CAN_CONTROL = 0x00000800, // Lua_UnitInVehicleControlSeat - SEAT_FLAG_UNK11 = 0x00001000, // "Can Cast Mount Spell" + // SEAT_FLAG_UNK11 = 0x00001000, // "Can Cast Mount Spell" | Note: there are no seats with this flag in 3.3.5a SEAT_FLAG_UNCONTROLLED = 0x00002000, // "Uncontrolled" SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle? SEAT_FLAG_UNK13 = 0x00008000, // "ShouldUseVehicleSeatExitAnimationOnForcedExit" @@ -523,9 +523,9 @@ enum VehicleSeatFlags SEAT_FLAG_UNK16 = 0x00040000, // "HasVehicleExitAnimForVoluntaryExit" SEAT_FLAG_UNK17 = 0x00080000, // "HasVehicleExitAnimForForcedExit" SEAT_FLAG_NOT_SELECTABLE = 0x00100000, - SEAT_FLAG_UNK19 = 0x00200000, + SEAT_FLAG_UNK19 = 0x00200000, // Note: only 4 seats are available with this flag in 3.3.5a; found only on flying dragons SEAT_FLAG_UNK20 = 0x00400000, // "RecHasVehicleEnterAnim" - SEAT_FLAG_UNK21 = 0x00800000, // Lua_IsUsingVehicleControls + // SEAT_FLAG_UNK21 = 0x00800000, // Lua_IsUsingVehicleControls | Note: there are no seats with this flag in 3.3.5a SEAT_FLAG_UNK22 = 0x01000000, // "EnableVehicleZoom" SEAT_FLAG_CAN_EXIT = 0x02000000, // Lua_CanExitVehicle SEAT_FLAG_CAN_SWITCH = 0x04000000, // Lua_CanSwitchVehicleSeats @@ -543,7 +543,7 @@ enum VehicleSeatFlagsB SEAT_FLAG_B_EJECTABLE = 0x00000020, // Ejectable SEAT_FLAG_B_USABLE_FORCED_2 = 0x00000040, SEAT_FLAG_B_USABLE_FORCED_3 = 0x00000100, - SEAT_FLAG_B_KEEP_PET = 0x00020000, + // SEAT_FLAG_B_KEEP_PET = 0x00020000, // Note: there are no seats with this flag in 3.3.5a SEAT_FLAG_B_USABLE_FORCED_4 = 0x02000000, SEAT_FLAG_B_CAN_SWITCH = 0x04000000, SEAT_FLAG_B_PLAYERFRAME_UI = 0x80000000 // Lua_UnitHasVehiclePlayerFrameUI