[8680] Spawn objects only in loaded grids (not just created)

Real object creating in grid make sense only if grid data already loaded, in other cases
gameevent/pool related object will loaded at normal grid data loading.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
seirge 2009-10-20 11:20:28 +04:00 committed by VladimirMangos
parent dcadfb7cae
commit f015e77a07
4 changed files with 11 additions and 5 deletions

View file

@ -296,6 +296,12 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
return( !getNGrid(p.x_coord, p.y_coord) || getNGrid(p.x_coord, p.y_coord)->GetGridState() == GRID_STATE_REMOVAL );
}
bool IsLoaded(float x, float y) const
{
GridPair p = MaNGOS::ComputeGridPair(x, y);
return loaded(p);
}
bool GetUnloadLock(const GridPair &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); }
void SetUnloadLock(const GridPair &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); }
void LoadGrid(const Cell& cell, bool no_unload = false);