From 75cd06b98c7dc489ee4554cf3af6a8f6403decee Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 7 Jan 2009 11:56:57 -0600 Subject: *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 --- src/game/Level3.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/game/Level3.cpp') diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 9c8c234c91c..3ac749531fb 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -840,19 +840,10 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args) return false; } - uint32 targetSecurity = accmgr.GetSecurity(targetAccountId); - - /// m_session==NULL only for console - uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE; - /// can set password only for target with less security /// This is also reject self apply in fact - if (targetSecurity >= plSecurity) - { - SendSysMessage (LANG_YOURS_SECURITY_IS_LOW); - SetSentErrorMessage (true); + if(HasLowerSecurityAccount (NULL,targetAccountId,true)) return false; - } if (strcmp(szPassword1,szPassword2)) { @@ -6277,8 +6268,15 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args) SetSentErrorMessage(true); return false; } + } + // Let set addon state only for lesser (strong) security level + // or to self account + if (m_session && m_session->GetAccountId () != account_id && + HasLowerSecurityAccount (NULL,account_id,true)) + return false; + int lev=atoi(szExp); //get int anyway (0 if error) if(lev < 0) return false; -- cgit v1.2.3