Fix crash when applying mind control to vehicles

Closes issue #2816
What should happen when mind control is applied to vehicles?

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-06-27 00:58:04 +02:00
parent 59ca58a49f
commit 0fd3e47edc

View File

@@ -3910,6 +3910,9 @@ void AuraEffect::HandleModPossessPet(AuraApplication const * aurApp, uint8 mode,
if (caster->ToPlayer()->GetPet() != target)
return;
if (target->IsVehicle()) //Avoid crash when mind controling vehicles due to an assert in Unit::SetCharmedBy
return;
target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
}
else