aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level3.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-07 11:56:57 -0600
committermegamage <none@none>2009-01-07 11:56:57 -0600
commit75cd06b98c7dc489ee4554cf3af6a8f6403decee (patch)
tree4d9c2810ef818bc6a8a7f4f94a2375cc8dd41d71 /src/game/Level3.cpp
parentfd07b66887e3a99ab7eeca9d00df12e57750558b (diff)
*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
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r--src/game/Level3.cpp18
1 files changed, 8 insertions, 10 deletions
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;