aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level3.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-15 17:33:36 -0600
committermegamage <none@none>2009-02-15 17:33:36 -0600
commitbb75ff7b79e89dac82f3ee1c740eb6079c7ec43b (patch)
treea48ea1fe70e395573e7ca4be4058fe894bbc2bdf /src/game/Level3.cpp
parent058b7c32e40332a620d8e294b4defba81e14dfc0 (diff)
*Cleanup of charm/farsight code. Hope this can fix some crash bugs.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r--src/game/Level3.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index a36571d20a4..f1a08f0b2c4 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -7290,19 +7290,19 @@ bool ChatHandler::HandlePossessCommand(const char* args)
if(!pUnit)
return false;
- // Don't allow unlimited possession of players
- if (pUnit->GetTypeId() == TYPEID_PLAYER)
- return false;
-
- pUnit->SetCharmedOrPossessedBy(m_session->GetPlayer(), true);
-
+ m_session->GetPlayer()->CastSpell(pUnit, 530, true);
return true;
}
bool ChatHandler::HandleUnPossessCommand(const char* args)
{
- // Use this command to also unpossess ourselves
- m_session->GetPlayer()->RemoveCharmedOrPossessedBy(NULL);
+ Unit* pUnit = getSelectedUnit();
+ if(!pUnit) pUnit = m_session->GetPlayer();
+
+ pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
+ pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
+ pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
+
return true;
}
@@ -7312,11 +7312,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args)
if (!pUnit)
return false;
- if (m_session->GetPlayer()->isPossessing())
- return false;
-
- pUnit->AddPlayerToVision(m_session->GetPlayer());
-
+ m_session->GetPlayer()->CastSpell(pUnit, 6277, true);
return true;
}
@@ -7325,6 +7321,6 @@ bool ChatHandler::HandleUnbindSightCommand(const char* args)
if (m_session->GetPlayer()->isPossessing())
return false;
- m_session->GetPlayer()->RemoveFarsightTarget();
+ m_session->GetPlayer()->StopCastingBindSight();
return true;
}