Trinitycore: [3.3.5] Core/Spell: Far Sight Updates

Created on 5 May 2016  路  9Comments  路  Source: TrinityCore/TrinityCore

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:

  • Player movement in the target area will not display.
  • NPCs will finish their current waypoint, then appear to the caster to stand in place.

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:

  1. Create a shaman, and teach them Far Sight (Spell 6196).
  2. Use Far Sight to observe a remote location that the caster usually would not be able to see units in due to range. To observe this problem, pick a target location with a co-operating player and/or an NPC that constantly patrols.
  3. Wait for an NPC to patrol or get the player in the target area to move. The caster's view will not reflect player movement unless they re-cast Far Sight.

Branch(es): 335

TC hash/commit: b91bed0

TDB version: 335.61

Operating system: Linux

Linking model: dynamic

Branch-3.3.5a Comp-Core Feedback-PatchFix Sub-Spells

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)).

All 9 comments

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);
 }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

DDuarte picture DDuarte  路  3Comments

Keader picture Keader  路  3Comments

tje3d picture tje3d  路  3Comments

Rushor picture Rushor  路  3Comments

cbcs picture cbcs  路  3Comments