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

Merged commit 269 (5f0e38da128a).

Original author: gvcoman
Date: 2008-11-21 14:34:05-05:00

Files:
1 modified

Legend:

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

    r275 r279  
    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 
     
    5656    } 
    5757 
     58    if(pItem->GetGUID() != item_guid) 
     59    { 
     60        pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL ); 
     61        return; 
     62    } 
     63 
    5864    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()); 
    5965 
     
    239245 
    240246            pItem->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, 0); 
    241             pItem->SetUInt32Value(OBJECT_FIELD_ENTRY, entry); 
     247            pItem->SetEntry(entry); 
    242248            pItem->SetUInt32Value(ITEM_FIELD_FLAGS, flags); 
    243249            pItem->SetState(ITEM_CHANGED, pUser); 
     
    261267 
    262268    uint64 guid; 
    263     uint32 spellId = OPEN_CHEST; 
    264269 
    265270    recv_data >> guid; 
     
    324329 
    325330    Spell *spell = new Spell(_player, spellInfo, false); 
    326     spell->m_cast_count = cast_count;                       //set count of casts 
     331    spell->m_cast_count = cast_count;                       // set count of casts 
    327332    spell->prepare(&targets); 
    328333} 
     
    365370                spellInfo->EffectApplyAuraName[i] == SPELL_AURA_BIND_SIGHT) 
    366371            { 
     372                // Fix me: creature may be killed during player aura cancel 
    367373                _player->RemoveAurasDueToSpellByCancel(spellId); 
    368374                if (_player->GetCharm()) 
    369375                    _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); 
    370                 else if (_player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 
     376                else if (_player->GetFarsightTarget() && _player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 
    371377                    ((Unit*)_player->GetFarsightTarget())->RemoveAurasDueToSpellByCancel(spellId); 
    372378                return;