3504 | | MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj); |
3505 | | m_caster->SetUInt64Value(PLAYER_FARSIGHT, dynObj->GetGUID()); |
| 3507 | |
| 3508 | CellPair pair = Trinity::ComputeCellPair(dynObj->GetPositionX(), dynObj->GetPositionY()); |
| 3509 | Cell cell(pair); |
| 3510 | Map* map = MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj); |
| 3511 | map->LoadGrid(cell); // In case the spell is casted into a different grid by player |
| 3512 | map->Add(dynObj); |
| 3513 | map->SwitchGridContainers(dynObj, true); // Needed for forwarding player packets |
| 3514 | dynObj->setActive(true); // Keep the grid updated even if there are no players in it |
| 3515 | |
| 3516 | // Need to update visibility of object for client to accept farsight guid |
| 3517 | ((Player*)m_caster)->UpdateVisibilityOf(dynObj); |
| 3518 | ((Player*)m_caster)->SetFarsightTarget(dynObj); |