Core/Vehicles: Store guids in vehicleseat structures instead of pointers. Fixes a crash with vendor-carrying Mammoth mounts.

This commit is contained in:
Machiavelli
2010-12-31 17:23:51 +01:00
parent 1b18a0ac65
commit 72a115f242
3 changed files with 43 additions and 19 deletions
@@ -655,10 +655,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
if (Unit *unit = ObjectAccessor::GetUnit(*_player, guid)) // creatures can be ejected too from player mounts
{
VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(unit);
ASSERT(seat);
if (seat->IsEjectable())
{
ASSERT(GetPlayer() == vehicle->GetBase());
unit->ExitVehicle();
unit->ToCreature()->ForcedDespawn(1000);
ASSERT(!unit->IsOnVehicle(vehicle->GetBase()));
}
else
sLog->outError("Player %u attempted to eject creature GUID "UI64FMTD" from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));