Show
Ignore:
Timestamp:
11/22/08 01:55:20 (17 years ago)
Author:
yumileroy
Message:

Merge with 284 (54b0e67d97fe).

Original author: megamage
Date: 2008-11-21 19:49:54-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Unit.cpp

    r283 r284  
    4747#include "CellImpl.h" 
    4848#include "Path.h" 
     49#include "TemporarySummon.h" 
    4950 
    5051#include <math.h> 
     
    34123413    if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id)) 
    34133414    { 
     3415        // Unsummon any summoned as possessed creatures on channel interrupt 
     3416        SpellEntry const *spellInfo = m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo; 
     3417        for (int i = 0; i < 3; i++) 
     3418        { 
     3419            if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&  
     3420                (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||  
     3421                 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||  
     3422                 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 
     3423            { 
     3424                // Possession is removed in the UnSummon function 
     3425                if (GetCharm()) 
     3426                    ((TemporarySummon*)GetCharm())->UnSummon();  
     3427            } 
     3428        } 
     3429 
    34143430        if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 
    34153431            m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); 
     
    97919807 
    97929808CharmInfo::CharmInfo(Unit* unit) 
    9793 : m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0) 
     9809: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0), m_barInit(false) 
    97949810{ 
    97959811    for(int i =0; i<4; ++i) 
     
    98029818void CharmInfo::InitPetActionBar() 
    98039819{ 
     9820    if (m_barInit) 
     9821        return; 
     9822 
    98049823    // the first 3 SpellOrActions are attack, follow and stay 
    98059824    for(uint32 i = 0; i < 3; i++) 
     
    98169835        PetActionBar[i + 3].SpellOrAction = 0; 
    98179836    } 
    9818 } 
    9819  
    9820 void CharmInfo::InitEmptyActionBar() 
    9821 { 
    9822     for(uint32 x = 1; x < 10; ++x) 
     9837    m_barInit = true; 
     9838} 
     9839 
     9840void CharmInfo::InitEmptyActionBar(bool withAttack) 
     9841{ 
     9842    if (m_barInit) 
     9843        return; 
     9844 
     9845    for(uint32 x = 0; x < 10; ++x) 
    98239846    { 
    98249847        PetActionBar[x].Type = ACT_CAST; 
    98259848        PetActionBar[x].SpellOrAction = 0; 
    98269849    } 
    9827     PetActionBar[0].Type = ACT_COMMAND; 
    9828     PetActionBar[0].SpellOrAction = COMMAND_ATTACK; 
     9850    if (withAttack) 
     9851    { 
     9852        PetActionBar[0].Type = ACT_COMMAND; 
     9853        PetActionBar[0].SpellOrAction = COMMAND_ATTACK; 
     9854    } 
     9855    m_barInit = true; 
    98299856} 
    98309857