Show
Ignore:
Timestamp:
11/19/08 13:43:02 (17 years ago)
Author:
yumileroy
Message:

[svn] * Avoid access to bag item prototype for getting bag size, use related item update field instead as more fast source.
* Better check client inventory pos data received in some client packets to skip invalid cases.
* Removed some unnecessary database queries.
* Make guid lookup for adding ignore async.
* Added two parameter versions of the AsyncQuery? function
* Make queries for adding friends async. - Hunuza
* Replace some PQuery() calls with more simple Query() - Hunuza
* Mark spell as executed instead of deleteable to solve crash.
*** Source mangos.

**Its a big commit. so test with care... or without care.... whatever floats your boat.

Original author: KingPin?
Date: 2008-11-05 20:10:19-06:00

Files:
1 modified

Legend:

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

    r172 r173  
    238238    for (uint32 i = 0; i < CURRENT_MAX_SPELL; i++) 
    239239    { 
    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        } 
    243245    } 
    244246 
     
    31643166        if (m_currentSpells[i] && m_currentSpells[i]->getState() == SPELL_STATE_FINISHED) 
    31653167        { 
    3166             m_currentSpells[i]->SetDeletable(true);         // spell may be safely deleted now 
     3168            m_currentSpells[i]->SetReferencedFromCurrent(false); 
    31673169            m_currentSpells[i] = NULL;                      // remove pointer 
    31683170        } 
     
    32773279    uint32 CSpellType = pSpell->GetCurrentContainer(); 
    32783280 
    3279     pSpell->SetDeletable(false);                            // spell will not be deleted until gone from current pointers 
    32803281    if (pSpell == m_currentSpells[CSpellType]) return;      // avoid breaking self 
    32813282 
     
    33343335    // current spell (if it is still here) may be safely deleted now 
    33353336    if (m_currentSpells[CSpellType]) 
    3336         m_currentSpells[CSpellType]->SetDeletable(true); 
     3337        m_currentSpells[CSpellType]->SetReferencedFromCurrent(false); 
    33373338 
    33383339    // set new current spell 
    33393340    m_currentSpells[CSpellType] = pSpell; 
     3341    pSpell->SetReferencedFromCurrent(true); 
    33403342} 
    33413343 
     
    33553357        if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED) 
    33563358            m_currentSpells[spellType]->cancel(); 
    3357         m_currentSpells[spellType]->SetDeletable(true); 
     3359        m_currentSpells[spellType]->SetReferencedFromCurrent(false); 
    33583360        m_currentSpells[spellType] = NULL; 
    33593361    } 
     
    33913393            (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED) ) 
    33923394            m_currentSpells[CURRENT_GENERIC_SPELL]->cancel(); 
    3393         m_currentSpells[CURRENT_GENERIC_SPELL]->SetDeletable(true); 
     3395        m_currentSpells[CURRENT_GENERIC_SPELL]->SetReferencedFromCurrent(false); 
    33943396        m_currentSpells[CURRENT_GENERIC_SPELL] = NULL; 
    33953397    } 
     
    34053407            (withDelayed || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->getState() != SPELL_STATE_DELAYED) ) 
    34063408            m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->cancel(); 
    3407         m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->SetDeletable(true); 
     3409        m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->SetReferencedFromCurrent(false); 
    34083410        m_currentSpells[CURRENT_AUTOREPEAT_SPELL] = NULL; 
    34093411    } 
     
    34143416        if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 
    34153417            m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); 
    3416         m_currentSpells[CURRENT_CHANNELED_SPELL]->SetDeletable(true); 
     3418        m_currentSpells[CURRENT_CHANNELED_SPELL]->SetReferencedFromCurrent(false); 
    34173419        m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; 
    34183420    } 
     
    98619863    { 
    98629864        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 
    98649866        CombatStop(); 
    98659867        ClearComboPointHolders();