mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[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:
parent
dcadfb7cae
commit
f015e77a07
4 changed files with 11 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue