Changeset 279 for trunk/src/game/SpellHandler.cpp
- Timestamp:
- 11/22/08 00:36:22 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellHandler.cpp
r275 r279 11 11 * This program is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 … … 56 56 } 57 57 58 if(pItem->GetGUID() != item_guid) 59 { 60 pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL ); 61 return; 62 } 63 58 64 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()); 59 65 … … 239 245 240 246 pItem->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, 0); 241 pItem->Set UInt32Value(OBJECT_FIELD_ENTRY,entry);247 pItem->SetEntry(entry); 242 248 pItem->SetUInt32Value(ITEM_FIELD_FLAGS, flags); 243 249 pItem->SetState(ITEM_CHANGED, pUser); … … 261 267 262 268 uint64 guid; 263 uint32 spellId = OPEN_CHEST;264 269 265 270 recv_data >> guid; … … 324 329 325 330 Spell *spell = new Spell(_player, spellInfo, false); 326 spell->m_cast_count = cast_count; // set count of casts331 spell->m_cast_count = cast_count; // set count of casts 327 332 spell->prepare(&targets); 328 333 } … … 365 370 spellInfo->EffectApplyAuraName[i] == SPELL_AURA_BIND_SIGHT) 366 371 { 372 // Fix me: creature may be killed during player aura cancel 367 373 _player->RemoveAurasDueToSpellByCancel(spellId); 368 374 if (_player->GetCharm()) 369 375 _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); 370 else if (_player->GetFarsightTarget() ->GetTypeId() != TYPEID_DYNAMICOBJECT)376 else if (_player->GetFarsightTarget() && _player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) 371 377 ((Unit*)_player->GetFarsightTarget())->RemoveAurasDueToSpellByCancel(spellId); 372 378 return;