Changeset 173 for trunk/src/game/Unit.cpp
- Timestamp:
- 11/19/08 13:43:02 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Unit.cpp
r172 r173 238 238 for (uint32 i = 0; i < CURRENT_MAX_SPELL; i++) 239 239 { 240 // spell may be safely deleted now 241 if (m_currentSpells[i]) m_currentSpells[i]->SetDeletable(true); 242 m_currentSpells[i] = NULL; 240 if (m_currentSpells[i]) 241 { 242 m_currentSpells[i]->SetReferencedFromCurrent(false); 243 m_currentSpells[i] = NULL; 244 } 243 245 } 244 246 … … 3164 3166 if (m_currentSpells[i] && m_currentSpells[i]->getState() == SPELL_STATE_FINISHED) 3165 3167 { 3166 m_currentSpells[i]->Set Deletable(true); // spell may be safely deleted now3168 m_currentSpells[i]->SetReferencedFromCurrent(false); 3167 3169 m_currentSpells[i] = NULL; // remove pointer 3168 3170 } … … 3277 3279 uint32 CSpellType = pSpell->GetCurrentContainer(); 3278 3280 3279 pSpell->SetDeletable(false); // spell will not be deleted until gone from current pointers3280 3281 if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self 3281 3282 … … 3334 3335 // current spell (if it is still here) may be safely deleted now 3335 3336 if (m_currentSpells[CSpellType]) 3336 m_currentSpells[CSpellType]->Set Deletable(true);3337 m_currentSpells[CSpellType]->SetReferencedFromCurrent(false); 3337 3338 3338 3339 // set new current spell 3339 3340 m_currentSpells[CSpellType] = pSpell; 3341 pSpell->SetReferencedFromCurrent(true); 3340 3342 } 3341 3343 … … 3355 3357 if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED) 3356 3358 m_currentSpells[spellType]->cancel(); 3357 m_currentSpells[spellType]->Set Deletable(true);3359 m_currentSpells[spellType]->SetReferencedFromCurrent(false); 3358 3360 m_currentSpells[spellType] = NULL; 3359 3361 } … … 3391 3393 (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED) ) 3392 3394 m_currentSpells[CURRENT_GENERIC_SPELL]->cancel(); 3393 m_currentSpells[CURRENT_GENERIC_SPELL]->Set Deletable(true);3395 m_currentSpells[CURRENT_GENERIC_SPELL]->SetReferencedFromCurrent(false); 3394 3396 m_currentSpells[CURRENT_GENERIC_SPELL] = NULL; 3395 3397 } … … 3405 3407 (withDelayed || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->getState() != SPELL_STATE_DELAYED) ) 3406 3408 m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->cancel(); 3407 m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->Set Deletable(true);3409 m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->SetReferencedFromCurrent(false); 3408 3410 m_currentSpells[CURRENT_AUTOREPEAT_SPELL] = NULL; 3409 3411 } … … 3414 3416 if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 3415 3417 m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); 3416 m_currentSpells[CURRENT_CHANNELED_SPELL]->Set Deletable(true);3418 m_currentSpells[CURRENT_CHANNELED_SPELL]->SetReferencedFromCurrent(false); 3417 3419 m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; 3418 3420 } … … 9861 9863 { 9862 9864 InterruptNonMeleeSpells(true); 9863 m_Events.KillAllEvents( );9865 m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted ans will deleated at call in Map::RemoveAllObjectsInRemoveList 9864 9866 CombatStop(); 9865 9867 ClearComboPointHolders();