*Merge.
--HG-- branch : trunk
This commit is contained in:
+14
-2
@@ -307,9 +307,21 @@ void Map::RemoveFromGrid(DynamicObject* obj, NGridType *grid, Cell const& cell)
|
||||
template<class T>
|
||||
void Map::SwitchGridContainers(T* obj, bool on)
|
||||
{
|
||||
CellPair pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
Cell cell(pair);
|
||||
CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::SwitchGridContainers: Object " I64FMT " have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
|
||||
return;
|
||||
}
|
||||
|
||||
Cell cell(p);
|
||||
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
|
||||
return;
|
||||
|
||||
DEBUG_LOG("Switch object " I64FMT " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
|
||||
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
|
||||
assert( ngrid != NULL );
|
||||
|
||||
GridType &grid = (*ngrid)(cell.CellX(), cell.CellY());
|
||||
|
||||
if(on)
|
||||
|
||||
@@ -54,11 +54,10 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
|
||||
// creature in unloading grid can have respawn point in another grid
|
||||
// if it will be unloaded then it will not respawn in original grid until unload/load original grid
|
||||
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
|
||||
for(CreatureMapType::iterator iter=m.begin(), next; iter != m.end(); iter = next)
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end();)
|
||||
{
|
||||
next = iter; ++next;
|
||||
|
||||
Creature * c = iter->getSource();
|
||||
++iter;
|
||||
|
||||
assert(!c->isWorldCreature() && "ObjectGridRespawnMover don't must be called for pets");
|
||||
|
||||
|
||||
@@ -2224,6 +2224,10 @@ void Spell::cancel()
|
||||
if(m_spellState == SPELL_STATE_FINISHED)
|
||||
return;
|
||||
|
||||
SetReferencedFromCurrent(false);
|
||||
if(m_selfContainer)
|
||||
*m_selfContainer = NULL;
|
||||
|
||||
uint32 oldState = m_spellState;
|
||||
m_spellState = SPELL_STATE_FINISHED;
|
||||
|
||||
|
||||
@@ -3838,8 +3838,6 @@ void AuraEffect::HandleAuraModSilence(bool apply, bool Real)
|
||||
if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING )
|
||||
{
|
||||
currentSpell->cancel();
|
||||
currentSpell->SetReferencedFromCurrent(false);
|
||||
m_target->m_currentSpells[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||
&Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
|
||||
&Spell::EffectApplyAreaAura, //143 SPELL_EFFECT_APPLY_AREA_AURA_OWNER
|
||||
&Spell::EffectKnockBack, //144 SPELL_EFFECT_KNOCK_BACK_2 Spectral Blast
|
||||
&Spell::EffectNULL, //145 SPELL_EFFECT_145 Black Hole Effect
|
||||
&Spell::EffectPlayerPull, //145 SPELL_EFFECT_145 Black Hole Effect
|
||||
&Spell::EffectActivateRune, //146 SPELL_EFFECT_ACTIVATE_RUNE
|
||||
&Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail
|
||||
&Spell::EffectUnused, //148 SPELL_EFFECT_148 unused
|
||||
|
||||
@@ -387,8 +387,6 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
if(spell->m_spellInfo->Id==spellId)
|
||||
{
|
||||
spell->cancel();
|
||||
spell->SetReferencedFromCurrent(false);
|
||||
_player->m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user