Skip to content

Commit

Permalink
Update vehicle seat flags
Browse files Browse the repository at this point in the history
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 <xfurry.cmangos@outlook.com>
  • Loading branch information
xfurry committed Dec 30, 2017
1 parent df14c11 commit 6490f4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/game/Entities/Vehicle.cpp
Expand Up @@ -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 |
Expand Down
16 changes: 8 additions & 8 deletions src/game/Server/DBCEnums.h
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6490f4c

Please sign in to comment.