*Fix build.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-20 14:10:53 -06:00
parent 5fd5da0123
commit b7be6cb6da
3 changed files with 9 additions and 3 deletions

View File

@@ -454,6 +454,13 @@ Map::LoadGrid(const Cell& cell, bool no_unload)
//LoadVMap(63-cell.GridX(),63-cell.GridY());
}
void Map::LoadGrid(float x, float y)
{
CellPair pair = Trinity::ComputeCellPair(x, y);
Cell cell(pair);
EnsureGridLoadedForPlayer(cell, NULL, false);
}
bool Map::Add(Player *player)
{
player->GetMapRef().link(this, player);

View File

@@ -161,6 +161,7 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
bool GetUnloadFlag(const GridPair &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadFlag(); }
void SetUnloadFlag(const GridPair &p, bool unload) { getNGrid(p.x_coord, p.y_coord)->setUnloadFlag(unload); }
void LoadGrid(const Cell& cell, bool no_unload = false);
void LoadGrid(float x, float y);
bool UnloadGrid(const uint32 &x, const uint32 &y, bool pForce);
virtual void UnloadAll(bool pForce);

View File

@@ -3466,10 +3466,8 @@ void Spell::EffectAddFarsight(uint32 i)
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002);
m_caster->AddDynObject(dynObj);
CellPair pair = Trinity::ComputeCellPair(dynObj->GetPositionX(), dynObj->GetPositionY());
Cell cell(pair);
Map* map = dynObj->GetMap();
map->EnsureGridLoadedForPlayer(cell, NULL, false); // In case the spell is casted into a different grid by player
map->LoadGrid(dynObj->GetPositionX(), dynObj->GetPositionY()); // In case the spell is casted into a different grid by player
map->Add(dynObj);
map->SwitchGridContainers(dynObj, true); // Needed for forwarding player packets
dynObj->setActive(true); // Keep the grid updated even if there are no players in it