diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-08 21:13:18 +0100 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-08 21:13:18 +0100 |
commit | 58f795d171e1a15aec6c7c8f619a741d623e4d52 (patch) | |
tree | 391df603be57ea8b20dbceeb122f16de13d669bd | |
parent | aa87c61cfb42986722980a604f203ff1644bbe30 (diff) |
Core/Vehicles: Logic fix for AddPassenger seat validity check, thanks to Tassader
-rwxr-xr-x | src/server/game/Entities/Vehicle/Vehicle.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index c31f4c40221..2395ff017a7 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -228,7 +228,6 @@ int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next, bool byAura) const while (seat->second.passenger || (!byAura && !seat->second.seatInfo->CanEnterOrExit()) || (byAura && !seat->second.seatInfo->IsUsableByAura())) { - sLog->outDebug("Vehicle::GetNextEmptySeat: m_flags: %u, m_flagsB:%u", seat->second.seatInfo->m_flags, seat->second.seatInfo->m_flagsB); if (next) { ++seat; @@ -287,7 +286,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) if (seatId < 0) // no specific seat requirement { for (seat = m_Seats.begin(); seat != m_Seats.end(); ++seat) - if (!seat->second.passenger && (!byAura && seat->second.seatInfo->CanEnterOrExit()) || (byAura && seat->second.seatInfo->IsUsableByAura())) + if (!seat->second.passenger && ((!byAura && seat->second.seatInfo->CanEnterOrExit()) || (byAura && seat->second.seatInfo->IsUsableByAura()))) break; if (seat == m_Seats.end()) // no available seat @@ -303,7 +302,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), seat->second.passenger)) passenger->ExitVehicle(); else - seat->second.passenger = 0; + seat->second.passenger = NULL; ASSERT(!seat->second.passenger); } |