Jump to content
TrinityCore

Hiding transport objects from phase


SaiFi
 Share

Recommended Posts

Hi,

I've tried everything but I cannot hide a transport object like the ships in Howling Fjord from other phases like all other objects do. I changed my phaseMask to 2 yet I can see the ships. Infact I don't know how its spawned either as its not in the gameobject table. Could any one give a few pointers to solve this issue?

Link to comment
Share on other sites

  • 2 months later...

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index cc62e30..4178572 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -23368,6 +23368,8 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target,
     // @HACK: This is to prevent objects like deeprun tram from disappearing when player moves far from its spawn point while riding it
     if ((target->GetGOInfo()->type != GAMEOBJECT_TYPE_TRANSPORT))
         s64.insert(target->GetGUID());
+    if (target->GetGOInfo()->flags & GO_FLAG_TRANSPORT_PHASING)
+        s64.insert(target->GetGUID());
 }
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index f2a11e4..86cc801 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -1488,15 +1488,16 @@ enum GameobjectTypes
 
 enum GameObjectFlags
 {
-    GO_FLAG_IN_USE          = 0x00000001,                   // disables interaction while animated
-    GO_FLAG_LOCKED          = 0x00000002,                   // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
-    GO_FLAG_INTERACT_COND   = 0x00000004,                   // cannot interact (condition to interact)
-    GO_FLAG_TRANSPORT       = 0x00000008,                   // any kind of transport? Object can transport (elevator, boat, car)
-    GO_FLAG_NOT_SELECTABLE  = 0x00000010,                   // not selectable even in GM mode
-    GO_FLAG_NODESPAWN       = 0x00000020,                   // never despawn, typically for doors, they just change state
-    GO_FLAG_TRIGGERED       = 0x00000040,                   // typically, summoned objects. Triggered by spell or other events
-    GO_FLAG_DAMAGED         = 0x00000200,
-    GO_FLAG_DESTROYED       = 0x00000400
+    GO_FLAG_IN_USE            = 0x00000001,                   // disables interaction while animated
+    GO_FLAG_LOCKED            = 0x00000002,                   // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
+    GO_FLAG_INTERACT_COND     = 0x00000004,                   // cannot interact (condition to interact)
+    GO_FLAG_TRANSPORT         = 0x00000008,                   // any kind of transport? Object can transport (elevator, boat, car)
+    GO_FLAG_NOT_SELECTABLE    = 0x00000010,                   // not selectable even in GM mode
+    GO_FLAG_NODESPAWN         = 0x00000020,                   // never despawn, typically for doors, they just change state
+    GO_FLAG_TRIGGERED         = 0x00000040,                   // typically, summoned objects. Triggered by spell or other events
+    GO_FLAG_DAMAGED           = 0x00000200,
+    GO_FLAG_DESTROYED         = 0x00000400,
+    GO_FLAG_TRANSPORT_PHASING = 0x00000800,                   // Enable Phasing even if the GO is a transport
 };
 
 enum GameObjectDynamicLowFlags

this should work, if you add the flag in the db

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...