Core/Auras: Properly clean up partial charm applications
Port From (https://github.com/TrinityCore/TrinityCore/commit/57d9d16442677201bc7c27729e3f167830b2e495)
This commit is contained in:
@@ -368,7 +368,13 @@ namespace Game.Entities
|
|||||||
// charm is set by aura, and aura effect remove handler was called during apply handler execution
|
// charm is set by aura, and aura effect remove handler was called during apply handler execution
|
||||||
// prevent undefined behaviour
|
// prevent undefined behaviour
|
||||||
if (aurApp != null && aurApp.GetRemoveMode() != 0)
|
if (aurApp != null && aurApp.GetRemoveMode() != 0)
|
||||||
|
{
|
||||||
|
// properly clean up charm changes up to this point to avoid leaving the unit in partially charmed state
|
||||||
|
SetFaction(_oldFactionId);
|
||||||
|
GetMotionMaster().InitializeDefault();
|
||||||
|
charmer.SetCharm(this, false);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Pets already have a properly initialized CharmInfo, don't overwrite it.
|
// Pets already have a properly initialized CharmInfo, don't overwrite it.
|
||||||
if (type != CharmType.Vehicle && GetCharmInfo() == null)
|
if (type != CharmType.Vehicle && GetCharmInfo() == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user