mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge branch 'master' into 303
This commit is contained in:
commit
295fb07520
5 changed files with 28 additions and 25 deletions
|
|
@ -564,6 +564,12 @@ void Map::Update(const uint32 &t_diff)
|
||||||
{
|
{
|
||||||
resetMarkedCells();
|
resetMarkedCells();
|
||||||
|
|
||||||
|
MaNGOS::ObjectUpdater updater(t_diff);
|
||||||
|
// for creature
|
||||||
|
TypeContainerVisitor<MaNGOS::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater);
|
||||||
|
// for pets
|
||||||
|
TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
|
||||||
|
|
||||||
//TODO: Player guard
|
//TODO: Player guard
|
||||||
HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer();
|
HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer();
|
||||||
for(HashMapHolder<Player>::MapType::iterator iter = playerMap.begin(); iter != playerMap.end(); ++iter)
|
for(HashMapHolder<Player>::MapType::iterator iter = playerMap.begin(); iter != playerMap.end(); ++iter)
|
||||||
|
|
@ -592,33 +598,28 @@ void Map::Update(const uint32 &t_diff)
|
||||||
end_cell >> 1; end_cell += 1; // lower right
|
end_cell >> 1; end_cell += 1; // lower right
|
||||||
|
|
||||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
||||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
|
||||||
markCell(x,y);
|
|
||||||
}
|
|
||||||
|
|
||||||
MaNGOS::ObjectUpdater updater(t_diff);
|
|
||||||
// for creature
|
|
||||||
TypeContainerVisitor<MaNGOS::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater);
|
|
||||||
// for pets
|
|
||||||
TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
|
|
||||||
|
|
||||||
for(int x = 0; x < TOTAL_NUMBER_OF_CELLS_PER_MAP; ++x)
|
|
||||||
{
|
|
||||||
for(int y = 0; y < TOTAL_NUMBER_OF_CELLS_PER_MAP; ++y)
|
|
||||||
{
|
{
|
||||||
if(isCellMarked(x,y))
|
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||||
{
|
{
|
||||||
CellPair pair(x,y);
|
// marked cells are those that have been visited
|
||||||
Cell cell(pair);
|
// don't visit the same cell twice
|
||||||
cell.data.Part.reserved = CENTER_DISTRICT;
|
uint32 cell_id = (y * TOTAL_NUMBER_OF_CELLS_PER_MAP) + x;
|
||||||
cell.SetNoCreate();
|
if(!isCellMarked(cell_id))
|
||||||
CellLock<NullGuard> cell_lock(cell, pair);
|
{
|
||||||
cell_lock->Visit(cell_lock, grid_object_update, *this);
|
markCell(cell_id);
|
||||||
cell_lock->Visit(cell_lock, world_object_update, *this);
|
CellPair pair(x,y);
|
||||||
|
Cell cell(pair);
|
||||||
|
cell.data.Part.reserved = CENTER_DISTRICT;
|
||||||
|
cell.SetNoCreate();
|
||||||
|
CellLock<NullGuard> cell_lock(cell, pair);
|
||||||
|
cell_lock->Visit(cell_lock, grid_object_update, *this);
|
||||||
|
cell_lock->Visit(cell_lock, world_object_update, *this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
|
// Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
|
||||||
// This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended
|
// This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended
|
||||||
if (IsBattleGroundOrArena())
|
if (IsBattleGroundOrArena())
|
||||||
|
|
|
||||||
|
|
@ -241,8 +241,9 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||||
void UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair);
|
void UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair);
|
||||||
|
|
||||||
void resetMarkedCells() { marked_cells.reset(); }
|
void resetMarkedCells() { marked_cells.reset(); }
|
||||||
bool isCellMarked(uint32 x, uint32 y) { return marked_cells.test(y * TOTAL_NUMBER_OF_CELLS_PER_MAP + x); }
|
bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); }
|
||||||
void markCell(uint32 x, uint32 y) { marked_cells.set(y * TOTAL_NUMBER_OF_CELLS_PER_MAP + x); }
|
void markCell(uint32 pCellId) { marked_cells.set(pCellId); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadVMap(int pX, int pY);
|
void LoadVMap(int pX, int pY);
|
||||||
void LoadMap(uint32 mapid, uint32 instanceid, int x,int y);
|
void LoadMap(uint32 mapid, uint32 instanceid, int x,int y);
|
||||||
|
|
|
||||||
|
|
@ -10156,7 +10156,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||||
}
|
}
|
||||||
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
|
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
|
||||||
{
|
{
|
||||||
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s class script aura of spell %u)",
|
sLog.outDebug("ProcDamageAndSpell: casting spell (triggered by %s class script aura of spell %u)",
|
||||||
(isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
|
(isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
|
||||||
casted = HandleOverrideClassScriptAuraProc(pTarget, triggeredByAura, procSpell,i->cooldown);
|
casted = HandleOverrideClassScriptAuraProc(pTarget, triggeredByAura, procSpell,i->cooldown);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2451,6 +2451,7 @@ void World::UpdateSessions( time_t diff )
|
||||||
///- and remove not active sessions from the list
|
///- and remove not active sessions from the list
|
||||||
if(!itr->second->Update(diff)) // As interval = 0
|
if(!itr->second->Update(diff)) // As interval = 0
|
||||||
{
|
{
|
||||||
|
RemoveQueuedPlayer (itr->second);
|
||||||
delete itr->second;
|
delete itr->second;
|
||||||
m_sessions.erase(itr);
|
m_sessions.erase(itr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6824"
|
#define REVISION_NR "6826"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue