Public feed #599148

crazy GM invisibility

public text v1 · immutable
Raw Edit
·published 2007-07-02 01:06 UTC
rendered paste body
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp	(revision 3995)
+++ src/game/Player.cpp	(working copy)
@@ -1790,17 +1790,25 @@
     if(on)
     {
         m_GMFlags &= ~GM_INVISIBLE;                         //remove flag
+        SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_UNK3);
 
         SetVisibility(VISIBILITY_ON);
     }
     else
     {
         m_GMFlags |= GM_INVISIBLE;                          //add flag
+        RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_UNK3);
 
         SetAcceptWhispers(false);
         SetGameMaster(true);
 
-        SetVisibility(VISIBILITY_OFF);
+        // Reapply stealth/invisibility if active or show if not any
+        if(HasAuraType(SPELL_AURA_MOD_STEALTH))
+            SetVisibility(VISIBILITY_GROUP_STEALTH);
+        else if(HasAuraType(SPELL_AURA_MOD_INVISIBILITY))
+            SetVisibility(VISIBILITY_GROUP_INVISIBILITY);
+        else
+            SetVisibility(VISIBILITY_OFF);
     }
 }