[7563] Fixed some problems in use .account set gmlevel in game (when it allowed by DB settings).

* Not set own gmlevel if not targets and use account name in command syntax
* Propertly output targeted player account name at use at selected target.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
benemorius 2009-03-28 06:24:27 +03:00 committed by VladimirMangos
parent 1f654c7969
commit e0c60231bd
2 changed files with 5 additions and 3 deletions

View file

@ -758,6 +758,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
arg2 = arg1;
targetAccountId = targetPlayer->GetSession()->GetAccountId();
accmgr.GetName(targetAccountId, targetAccountName);
}
else
{
@ -791,7 +792,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
}
/// can set security level only for target with less security and to less security that we have
/// This is also reject self apply in fact
/// This will reject self apply by specify account name
if(HasLowerSecurityAccount(NULL,targetAccountId,true))
return false;
@ -804,7 +805,8 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
return false;
}
if(targetPlayer)
// This will prevent self apply by self target or no target
if(targetPlayer && m_session->GetPlayer()!=targetPlayer)
{
ChatHandler(targetPlayer).PSendSysMessage(LANG_YOURS_SECURITY_CHANGED,GetNameLink().c_str(), gm);
targetPlayer->GetSession()->SetSecurity(gm);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7562"
#define REVISION_NR "7563"
#endif // __REVISION_NR_H__