Temp fix for *nix build.
This commit is contained in:
@@ -31,7 +31,7 @@ void ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32
|
|||||||
info.UpdateTimeTracker(t_diff);
|
info.UpdateTimeTracker(t_diff);
|
||||||
if (info.getTimeTracker().Passed())
|
if (info.getTimeTracker().Passed())
|
||||||
{
|
{
|
||||||
if (!grid.GetWorldObjectCountInNGrid<Player>() && !m.ActiveObjectsNearGrid(grid))
|
if (!grid.GetPlayerCountInNGrid() && !m.ActiveObjectsNearGrid(grid))
|
||||||
{
|
{
|
||||||
ObjectGridStoper worker;
|
ObjectGridStoper worker;
|
||||||
TypeContainerVisitor<ObjectGridStoper, GridTypeMapContainer> visitor(worker);
|
TypeContainerVisitor<ObjectGridStoper, GridTypeMapContainer> visitor(worker);
|
||||||
|
|||||||
@@ -171,6 +171,8 @@ class NGrid
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//TODO: This does not compile in *nix. Hope somebody can find out how to write such template function.
|
||||||
|
/*
|
||||||
template<class T>
|
template<class T>
|
||||||
uint32 GetWorldObjectCountInNGrid() const
|
uint32 GetWorldObjectCountInNGrid() const
|
||||||
{
|
{
|
||||||
@@ -180,6 +182,26 @@ class NGrid
|
|||||||
count += i_cells[x][y].template GetWorldObjectCountInGrid<T>();
|
count += i_cells[x][y].template GetWorldObjectCountInGrid<T>();
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
//These two temporarily replace GetWorldObjectCountInNGrid
|
||||||
|
uint32 GetPlayerCountInNGrid() const
|
||||||
|
{
|
||||||
|
uint32 count = 0;
|
||||||
|
for (uint32 x = 0; x < N; ++x)
|
||||||
|
for (uint32 y = 0; y < N; ++y)
|
||||||
|
count += i_cells[x][y].GetWorldObjectCountInGrid<Player>();
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 GetWorldCreatureCountInNGrid() const
|
||||||
|
{
|
||||||
|
uint32 count = 0;
|
||||||
|
for (uint32 x = 0; x < N; ++x)
|
||||||
|
for (uint32 y = 0; y < N; ++y)
|
||||||
|
count += i_cells[x][y].GetWorldObjectCountInGrid<Creature>();
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 i_gridId;
|
uint32 i_gridId;
|
||||||
|
|||||||
@@ -915,7 +915,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll)
|
|||||||
if (!unloadAll)
|
if (!unloadAll)
|
||||||
{
|
{
|
||||||
//pets, possessed creatures (must be active), transport passengers
|
//pets, possessed creatures (must be active), transport passengers
|
||||||
if (ngrid.GetWorldObjectCountInNGrid<Creature>())
|
if (ngrid.GetWorldCreatureCountInNGrid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ActiveObjectsNearGrid(ngrid))
|
if (ActiveObjectsNearGrid(ngrid))
|
||||||
|
|||||||
Reference in New Issue
Block a user