Core-Vehicles: Change player mover when add/remove passenger (thanks Subv)

Core-Misc: Restore correct mover for victim of possesion spell.

Closes #4704, #4707
This commit is contained in:
elecyb
2012-01-08 03:56:33 -03:00
parent 7d7bb8363d
commit fc4b033715
3 changed files with 6 additions and 3 deletions
@@ -359,6 +359,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
{
if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
ASSERT(false);
unit->ToPlayer()->SetMover(this->GetBase());
}
if (_me->IsInWorld())
@@ -410,7 +411,10 @@ void Vehicle::RemovePassenger(Unit* unit)
unit->ClearUnitState(UNIT_STAT_ONVEHICLE);
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
{
_me->RemoveCharmedBy(unit);
unit->ToPlayer()->SetMover(unit->ToPlayer());
}
if (_me->IsInWorld())
{