diff options
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 14 | ||||
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3cfc497a0a2..44659254e7c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16676,7 +16676,7 @@ bool Unit::CheckPlayerCondition(Player* pPlayer) } } -void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) +void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, bool byAura) { if (!isAlive() || GetVehicleKit() == vehicle) return; @@ -16685,10 +16685,10 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) { if (m_vehicle == vehicle) { - if (seatId >= 0) + if (seatId >= 0 && seatId != GetTransSeat()) { sLog->outDebug("EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); - ChangeSeat(seatId); + ChangeSeat(seatId, byAura); } return; } @@ -16717,7 +16717,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) ASSERT(!m_vehicle); m_vehicle = vehicle; - if (!m_vehicle->AddPassenger(this, seatId)) + if (!m_vehicle->AddPassenger(this, seatId, byAura)) { m_vehicle = NULL; return; @@ -16735,14 +16735,14 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) } } -void Unit::ChangeSeat(int8 seatId, bool next) +void Unit::ChangeSeat(int8 seatId, bool next, bool byAura) { if (!m_vehicle) return; if (seatId < 0) { - seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next); + seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next, byAura); if (seatId < 0) return; } @@ -16750,7 +16750,7 @@ void Unit::ChangeSeat(int8 seatId, bool next) return; m_vehicle->RemovePassenger(this); - if (!m_vehicle->AddPassenger(this, seatId)) + if (!m_vehicle->AddPassenger(this, seatId, byAura)) ASSERT(false); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 33001d30080..15b248a5fff 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1968,10 +1968,10 @@ class Unit : public WorldObject bool m_ControlledByPlayer; bool CheckPlayerCondition(Player* pPlayer); - void EnterVehicle(Unit *base, int8 seatId = -1) { EnterVehicle(base->GetVehicleKit(), seatId); } - void EnterVehicle(Vehicle *vehicle, int8 seatId = -1); + void EnterVehicle(Unit *base, int8 seatId = -1, bool byAura = false) { EnterVehicle(base->GetVehicleKit(), seatId, byAura); } + void EnterVehicle(Vehicle *vehicle, int8 seatId = -1, bool byAura = false); void ExitVehicle(); - void ChangeSeat(int8 seatId, bool next = true); + void ChangeSeat(int8 seatId, bool next = true, bool byAura = false); void BuildMovementPacket(ByteBuffer *data) const; |
