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:
@@ -3910,6 +3910,9 @@ void AuraEffect::HandleModPossessPet(AuraApplication const * aurApp, uint8 mode,
|
|||||||
if (caster->ToPlayer()->GetPet() != target)
|
if (caster->ToPlayer()->GetPet() != target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (target->IsVehicle()) //Avoid crash when mind controling vehicles due to an assert in Unit::SetCharmedBy
|
||||||
|
return;
|
||||||
|
|
||||||
target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user