mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-19 22:39:39 -04:00
*Cleanup of charm/farsight code. Hope this can fix some crash bugs.
--HG-- branch : trunk
This commit is contained in:
+10
-14
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user