Core/Vehicles: Implemented vehicle seat flag that makes passengers unselectable and dropped redundant UNIT_STATE_ONVEHICLE (it is only checked in the same places as unselectable unit flag)
This commit is contained in:
1 parent
44c844d6fd
commit
13208ff257
9 files changed
+53
-36
No files matched your search
@@ -16855,7 +16855,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
|
||||
|
||||
SeatMap::const_iterator seat = (seatId < 0 ? m_vehicle->GetNextEmptySeat(GetTransSeat(), next) : m_vehicle->Seats.find(seatId));
|
||||
// The second part of the check will only return true if seatId >= 0. @Vehicle::GetNextEmptySeat makes sure of that.
|
||||
if (seat == m_vehicle->Seats.end() || seat->second.Passenger)
|
||||
if (seat == m_vehicle->Seats.end() || !seat->second.IsEmpty())
|
||||
return;
|
||||
|
||||
AuraEffect* rideVehicleEffect = NULL;
|
||||
@@ -17261,7 +17261,7 @@ void Unit::OutDebugInfo() const
|
||||
{
|
||||
o << "Passenger List: ";
|
||||
for (SeatMap::iterator itr = GetVehicleKit()->Seats.begin(); itr != GetVehicleKit()->Seats.end(); ++itr)
|
||||
if (Unit* passenger = ObjectAccessor::GetUnit(*GetVehicleBase(), itr->second.Passenger))
|
||||
if (Unit* passenger = ObjectAccessor::GetUnit(*GetVehicleBase(), itr->second.Passenger.Guid))
|
||||
o << passenger->GetGUID() << ", ";
|
||||
TC_LOG_INFO(LOG_FILTER_UNITS, "%s", o.str().c_str());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user