mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[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:
parent
1f654c7969
commit
e0c60231bd
2 changed files with 5 additions and 3 deletions
|
|
@ -758,6 +758,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||||
arg2 = arg1;
|
arg2 = arg1;
|
||||||
|
|
||||||
targetAccountId = targetPlayer->GetSession()->GetAccountId();
|
targetAccountId = targetPlayer->GetSession()->GetAccountId();
|
||||||
|
accmgr.GetName(targetAccountId, targetAccountName);
|
||||||
}
|
}
|
||||||
else
|
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
|
/// 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))
|
if(HasLowerSecurityAccount(NULL,targetAccountId,true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -804,7 +805,8 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||||
return false;
|
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);
|
ChatHandler(targetPlayer).PSendSysMessage(LANG_YOURS_SECURITY_CHANGED,GetNameLink().c_str(), gm);
|
||||||
targetPlayer->GetSession()->SetSecurity(gm);
|
targetPlayer->GetSession()->SetSecurity(gm);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7562"
|
#define REVISION_NR "7563"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue