aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index d449b3617f7..3dfc6f9c7e8 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -196,11 +196,16 @@ public:
return true;
}
+ const uint32 VISUAL_AURA = 37800;
std::string param = (char*)args;
+ Player* player = handler->GetSession()->GetPlayer();
if (param == "on")
{
- handler->GetSession()->GetPlayer()->SetGMVisible(true);
+ if (player->HasAura(VISUAL_AURA, 0))
+ player->RemoveAurasDueToSpell(VISUAL_AURA);
+
+ player->SetGMVisible(true);
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
return true;
}
@@ -208,7 +213,10 @@ public:
if (param == "off")
{
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
- handler->GetSession()->GetPlayer()->SetGMVisible(false);
+ player->SetGMVisible(false);
+
+ player->AddAura(VISUAL_AURA, player);
+
return true;
}