fixes:
Using the in-game `account set gmlevel $account $level` while
having no target results in $level being applied to self in
addition to $account. Patched behavior causes $level
to be applied only to targeted or specified $account. Self
target and no target are ignored
patches against: 7501
---
src/game/Level3.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index eb5f927..6f1be30 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -791,7 +791,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 +804,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);
--