Jump to content

[fix][7563] in-game set gmlevel erroneously applies level to self


Guest benemorius

Recommended Posts

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);
-- 

Link to comment
Share on other sites

add affected account name to chat reply of targeted set gmlevel

previously the affected account name was only available to the

reply when the account was specified in the command and not when

the player was targeted

---
src/game/Level3.cpp |    1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 6f1be30..c7d8a28 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -758,6 +758,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
        arg2 = arg1;

        targetAccountId = targetPlayer->GetSession()->GetAccountId();
+         accmgr.GetName(targetAccountId, targetAccountName);
    }
    else
    {
-- 

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use