mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7610] Fixed problems with Aura::HandleMosPossess for players
This commit is contained in:
parent
0fc68c5e1e
commit
e4daaaedb1
3 changed files with 16 additions and 9 deletions
|
|
@ -3067,21 +3067,28 @@ void Aura::HandleModPossess(bool apply, bool Real)
|
||||||
m_target->StopMoving();
|
m_target->StopMoving();
|
||||||
m_target->GetMotionMaster()->Clear();
|
m_target->GetMotionMaster()->Clear();
|
||||||
m_target->GetMotionMaster()->MoveIdle();
|
m_target->GetMotionMaster()->MoveIdle();
|
||||||
CharmInfo *charmInfo = ((Creature*)m_target)->InitCharmInfo(m_target);
|
}
|
||||||
charmInfo->InitPossessCreateSpells();
|
else if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
((Player*)m_target)->SetClientControl(m_target, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(CharmInfo *charmInfo = m_target->InitCharmInfo(m_target))
|
||||||
|
charmInfo->InitPossessCreateSpells();
|
||||||
|
|
||||||
if(caster->GetTypeId() == TYPEID_PLAYER)
|
if(caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
|
||||||
((Player*)caster)->PossessSpellInitialize();
|
((Player*)caster)->PossessSpellInitialize();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_target->SetCharmerGUID(0);
|
m_target->SetCharmerGUID(0);
|
||||||
|
caster->InterruptSpell(CURRENT_CHANNELED_SPELL); // the spell is not automatically canceled when interrupted, do it now
|
||||||
|
|
||||||
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
((Player*)m_target)->setFactionForRace(m_target->getRace());
|
((Player*)m_target)->setFactionForRace(m_target->getRace());
|
||||||
|
((Player*)m_target)->SetClientControl(m_target, 1);
|
||||||
|
}
|
||||||
else if(m_target->GetTypeId() == TYPEID_UNIT)
|
else if(m_target->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
|
CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
|
||||||
|
|
@ -3185,7 +3192,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
|
||||||
if(m_target->GetTypeId() == TYPEID_UNIT)
|
if(m_target->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
((Creature*)m_target)->AIM_Initialize();
|
((Creature*)m_target)->AIM_Initialize();
|
||||||
CharmInfo *charmInfo = ((Creature*)m_target)->InitCharmInfo(m_target);
|
CharmInfo *charmInfo = m_target->InitCharmInfo(m_target);
|
||||||
charmInfo->InitCharmCreateSpells();
|
charmInfo->InitCharmCreateSpells();
|
||||||
charmInfo->SetReactState( REACT_DEFENSIVE );
|
charmInfo->SetReactState( REACT_DEFENSIVE );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10177,11 +10177,11 @@ void CharmInfo::InitEmptyActionBar()
|
||||||
|
|
||||||
void CharmInfo::InitPossessCreateSpells()
|
void CharmInfo::InitPossessCreateSpells()
|
||||||
{
|
{
|
||||||
if(m_unit->GetTypeId() == TYPEID_PLAYER)
|
|
||||||
return;
|
|
||||||
|
|
||||||
InitEmptyActionBar(); //charm action bar
|
InitEmptyActionBar(); //charm action bar
|
||||||
|
|
||||||
|
if(m_unit->GetTypeId() == TYPEID_PLAYER) //possessed players don't have spells, keep the action bar empty
|
||||||
|
return;
|
||||||
|
|
||||||
for(uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x)
|
for(uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x)
|
||||||
{
|
{
|
||||||
if (IsPassiveSpell(((Creature*)m_unit)->m_spells[x]))
|
if (IsPassiveSpell(((Creature*)m_unit)->m_spells[x]))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7609"
|
#define REVISION_NR "7610"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue