Core/Movement: properly set mover for possess/vehicles
This commit is contained in:
@@ -3096,17 +3096,9 @@ void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, boo
|
||||
}
|
||||
|
||||
if (apply)
|
||||
{
|
||||
if (target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
|
||||
caster->ToPlayer()->SetMover(target);
|
||||
}
|
||||
target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
|
||||
else
|
||||
{
|
||||
target->RemoveCharmedBy(caster);
|
||||
caster->ToPlayer()->SetMover(caster);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->SetMover(target);
|
||||
}
|
||||
}
|
||||
|
||||
// only one spell has this aura
|
||||
@@ -3134,13 +3126,11 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
|
||||
if (caster->ToPlayer()->GetPet() != pet)
|
||||
return;
|
||||
|
||||
if (pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
|
||||
caster->ToPlayer()->SetMover(pet);
|
||||
pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
|
||||
}
|
||||
else
|
||||
{
|
||||
pet->RemoveCharmedBy(caster);
|
||||
caster->ToPlayer()->SetMover(caster);
|
||||
|
||||
if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
|
||||
pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
|
||||
Reference in New Issue
Block a user