Core/Vehicles: Fix a possible crash in InstallAccessory

Closes ticket #769
This commit is contained in:
Machiavelli
2011-02-27 04:05:21 +01:00
parent 683cea9e83
commit b161b0859b

View File

@@ -268,7 +268,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
passenger->ToCreature()->AI()->EnterEvadeMode();
return;
}
else if (passenger->ToTempSummon()->GetSummonType() == TEMPSUMMON_MANUAL_DESPAWN)
else if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY) && passenger->ToTempSummon()->GetSummonType() == TEMPSUMMON_MANUAL_DESPAWN)
{
passenger->ExitVehicle();
passenger->ToTempSummon()->DespawnOrUnsummon();