Skip to content

Commit

Permalink
[c12875] Make use of GROUP_UPDATE_FLAG_VEHICLE_SEAT
Browse files Browse the repository at this point in the history
Original patch by thenecromancer (TC)

(based on commit [12677] - 90a9e0d)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
  • Loading branch information
xfurry committed Aug 13, 2014
1 parent e77cad1 commit 7d215b9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/game/GroupHandler.cpp
Expand Up @@ -31,6 +31,8 @@
#include "Util.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "Vehicle.h"
#include "TransportSystem.h"

/* differeces from off:
-you can uninvite yourself - is is useful
Expand Down Expand Up @@ -899,6 +901,14 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
*data << uint32(0);
*data << uint8(0);
}

if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT)
{
if (player->GetTransportInfo())
*data << uint32(((Unit*)player->GetTransportInfo()->GetTransport())->GetVehicleInfo()->GetVehicleEntry()->m_seatID[player->GetTransportInfo()->GetTransportSeat()]);
else
*data << uint32(0);
}
}

/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
Expand Down Expand Up @@ -1042,6 +1052,9 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
data << uint32(0); // GROUP_UPDATE_FLAG_PET_AURAS
}

if (player->GetTransportInfo()) // GROUP_UPDATE_FLAG_VEHICLE_SEAT
data << uint32(((Unit*)player->GetTransportInfo()->GetTransport())->GetVehicleInfo()->GetVehicleEntry()->m_seatID[player->GetTransportInfo()->GetTransportSeat()]);

data << uint32(8); // GROUP_UPDATE_FLAG_PHASE
data << uint32(0); // GROUP_UPDATE_FLAG_PHASE
data << uint8(0); // GROUP_UPDATE_FLAG_PHASE
Expand Down
8 changes: 8 additions & 0 deletions src/game/Vehicle.cpp
Expand Up @@ -511,6 +511,10 @@ void VehicleInfo::ApplySeatMods(Unit* passenger, uint32 seatFlags)
{
Player* pPlayer = (Player*)passenger;

// group update
if (pPlayer->GetGroup())
pPlayer->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_VEHICLE_SEAT);

if (seatFlags & SEAT_FLAG_CAN_CONTROL)
{
pPlayer->GetCamera().SetView(pVehicle);
Expand Down Expand Up @@ -577,6 +581,10 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
{
Player* pPlayer = (Player*)passenger;

// group update
if (pPlayer->GetGroup())
pPlayer->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_VEHICLE_SEAT);

if (seatFlags & SEAT_FLAG_CAN_CONTROL)
{
pPlayer->SetCharm(NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12874"
#define REVISION_NR "12875"
#endif // __REVISION_NR_H__

0 comments on commit 7d215b9

Please sign in to comment.