mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
*Mangos Implement AURA_STATE_HEALTH_ABOVE_75_PERCENT use. By DiSlord.
*Mangos [7045]. More correct spell select for creatures if spell PreventionType == SPELL_PREVENTION_TYPE_SILENCE. Also add check for PreventionType == SPELL_PREVENTION_TYPE_PACIFY. By DiSlord. *Mangos [7046] Do more security level checks in commands using HasLowerSecurity. Make use .account set addon safe for players. By Vladimir. *Mangos [7047] Fix Draenei race spell add at client switch. By DiSlord. --HG-- branch : trunk
This commit is contained in:
@@ -88,27 +88,11 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
|
||||
Player *chr = objmgr.GetPlayer(guid);
|
||||
|
||||
// check security
|
||||
uint32 account_id = 0;
|
||||
uint32 security = 0;
|
||||
|
||||
if (chr)
|
||||
{
|
||||
account_id = chr->GetSession()->GetAccountId();
|
||||
security = chr->GetSession()->GetSecurity();
|
||||
}
|
||||
else
|
||||
{
|
||||
account_id = objmgr.GetPlayerAccountIdByGUID(guid);
|
||||
security = accmgr.GetSecurity(account_id);
|
||||
}
|
||||
|
||||
if(m_session && security >= m_session->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||
SetSentErrorMessage(true);
|
||||
// must have strong lesser security level
|
||||
if(HasLowerSecurity (chr,guid,true))
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 account_id = chr ? chr->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(guid);
|
||||
|
||||
time_t mutetime = time(NULL) + notspeaktime*60;
|
||||
|
||||
@@ -154,27 +138,11 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
|
||||
Player *chr = objmgr.GetPlayer(guid);
|
||||
|
||||
// check security
|
||||
uint32 account_id = 0;
|
||||
uint32 security = 0;
|
||||
|
||||
if (chr)
|
||||
{
|
||||
account_id = chr->GetSession()->GetAccountId();
|
||||
security = chr->GetSession()->GetSecurity();
|
||||
}
|
||||
else
|
||||
{
|
||||
account_id = objmgr.GetPlayerAccountIdByGUID(guid);
|
||||
security = accmgr.GetSecurity(account_id);
|
||||
}
|
||||
|
||||
if(m_session && security >= m_session->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||
SetSentErrorMessage(true);
|
||||
// must have strong lesser security level
|
||||
if(HasLowerSecurity (chr,guid,true))
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 account_id = chr ? chr->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(guid);
|
||||
|
||||
if (chr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user