Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Files:
1 modified

Legend:

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

    r267 r272  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1919 */ 
    2020 
     
    5555    } 
    5656 
    57     if(pItem->GetGUID() != item_guid) 
    58     { 
    59         pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL ); 
    60         return; 
    61     } 
    62  
    6357    sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, spell_count: %u , cast_count: %u, Item: %u, data length = %i", bagIndex, slot, spell_count, cast_count, pItem->GetEntry(), recvPacket.size()); 
    6458 
     
    244238 
    245239            pItem->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, 0); 
    246             pItem->SetEntry(entry); 
     240            pItem->SetUInt32Value(OBJECT_FIELD_ENTRY, entry); 
    247241            pItem->SetUInt32Value(ITEM_FIELD_FLAGS, flags); 
    248242            pItem->SetState(ITEM_CHANGED, pUser); 
     
    266260 
    267261    uint64 guid; 
     262    uint32 spellId = OPEN_CHEST; 
    268263 
    269264    recv_data >> guid; 
     
    328323 
    329324    Spell *spell = new Spell(_player, spellInfo, false); 
    330     spell->m_cast_count = cast_count;                       // set count of casts 
     325    spell->m_cast_count = cast_count;                       //set count of casts 
    331326    spell->prepare(&targets); 
    332327} 
     
    369364                spellInfo->EffectApplyAuraName[i] == SPELL_AURA_BIND_SIGHT) 
    370365            { 
    371                 // Fix me: creature may be killed during player aura cancel 
    372366                _player->RemoveAurasDueToSpellByCancel(spellId); 
    373367                if (_player->GetCharm()) 
    374368                    _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); 
    375                 else if (_player->GetFarsightTarget() && _player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 
     369                else if (_player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 
    376370                    ((Unit*)_player->GetFarsightTarget())->RemoveAurasDueToSpellByCancel(spellId); 
    377371                return;