Description: Locations viewed via Far Sight to not show updates.
Discovered while discussing #17041, marking as a separate issue to note as a to-do. The problem is similar to #17041, but the PR does not have an effect on Far Sight.
Current behaviour:
Distant locations (out of normal caster sight) that are scryed via Far Sight display a "freeze-frame" of current activity.
Examples:
Information will be updated if the spell is re-cast, but I think that this is more on account of sight going back to the caster for so long during the cast time.
Expected behaviour:
The caster should be able to see activities play out in the remote location as though they were standing there.
Steps to reproduce the problem:
Branch(es): 335
TC hash/commit: b91bed0
TDB version: 335.61
Operating system: Linux
Linking model: dynamic
FYI this also happens with hunter's Eagle Eye spell.
OS: Windows XP / Windows 7
Shaman totem too :)
Still present in 013d4560c784b1deced9cd2ea11606eaf6b44f2d Any idea how to fix it someone ?
@r00ty-tc , does this kind of issue need some form of "Camera" management for the far view abilities?
does this kind of issue need some form of "Camera" management for the far view abilities?
Either that or some method of loading the grid where the target is so you can trigger the NPC spawns.
I made some researches and found some details.
In functions WorldObject::BuildUpdate or WorldObject::SendMessageToSetInRange called Cell::VisitWorldObjects , but this method does not Visit dynamic objects (including Far Sight). It is very strange, because in Spell::EffectAddFarsight DynamicObject created as WorldObject. If change in WorldObject::BuildUpdate to Cell::VisitAllObjects - Far vision becomes working. Maybe someone can figure out what is the reason - why dynamic object not count as worldobject when called Cell::VisitWorldObjects
On azerothcore this works fine, maybe @xvwyh you can help us how to fix this issue?
Compare
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Maps/Map.cpp#L314
and
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Maps/Map.cpp#L335
As you can see, there is a special case for obj->IsWorldObject()
for Creatures, but there isn't one for DynamicObjects. Add it.
It was lost when transports were being implemented, and thus gameobject/dynobject relocation support was being added. This commit added a DynamicObject specialization for Map::AddToGrid and neglected to include the worldobject case, which was previously working because it is included in the templated version (void Map::AddToGrid(T* obj, Cell const& cell)
).
Tested and worked @xvwyh
can you open a pr?
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index add703f617..8001aa6641 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -336,7 +336,10 @@ template<>
void Map::AddToGrid(DynamicObject* obj, Cell const& cell)
{
NGridType* grid = getNGrid(cell.GridX(), cell.GridY());
- grid->GetGridType(cell.CellX(), cell.CellY()).AddGridObject(obj);
+ if (obj->IsWorldObject())
+ grid->GetGridType(cell.CellX(), cell.CellY()).AddWorldObject(obj);
+ else
+ grid->GetGridType(cell.CellX(), cell.CellY()).AddGridObject(obj);
obj->SetCurrentCell(cell);
}
Most helpful comment
Compare
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Maps/Map.cpp#L314
and
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Maps/Map.cpp#L335
As you can see, there is a special case for
obj->IsWorldObject()
for Creatures, but there isn't one for DynamicObjects. Add it.It was lost when transports were being implemented, and thus gameobject/dynobject relocation support was being added. This commit added a DynamicObject specialization for Map::AddToGrid and neglected to include the worldobject case, which was previously working because it is included in the templated version (
void Map::AddToGrid(T* obj, Cell const& cell)
).