diff --git a/src/game/Map.cpp b/src/game/Map.cpp index a0504c6a5..d934afeb1 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -334,13 +334,17 @@ bool Map::EnsureGridLoaded(const Cell &cell) MANGOS_ASSERT(grid != NULL); if( !isGridObjectDataLoaded(cell.GridX(), cell.GridY()) ) { + //it's important to set it loaded before loading! + //otherwise there is a possibility of infinity chain (grid loading will be called many times for the same grid) + //possible scenario: + //active object A(loaded with loader.LoadN call and added to the map) + //summons some active object B, while B added to map grid loading called again and so on.. + setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); ObjectGridLoader loader(*grid, this, cell); loader.LoadN(); // Add resurrectable corpses to world object list in grid sObjectAccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); - - setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); return true; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index dec496af0..f14e98144 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10604" + #define REVISION_NR "10605" #endif // __REVISION_NR_H__