From 46c9aa6f3a500e8ce7f052236972369b53bf3924 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 1 May 2021 17:07:15 +0200 Subject: [PATCH] fix(Script/Command): HandleAddItemCommand (#5412) * fix(Core/Command): Additem * Update cs_misc.cpp --- src/server/scripts/Commands/cs_misc.cpp | 28 +++++++++++-------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 02dbaecaf..95f45e463 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1541,15 +1541,19 @@ public: // Subtract if (count < 0) { - if (!playerTarget->HasItemCount(itemId, 0)) + // Only have scam check on player accounts + if (playerTarget->GetSession()->GetSecurity() == SEC_PLAYER) { - // output that player don't have any items to destroy - handler->PSendSysMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId); - } - else if (!playerTarget->HasItemCount(itemId, -count)) - { - // output that player don't have as many items that you want to destroy - handler->PSendSysMessage(LANG_REMOVEITEM_ERROR, handler->GetNameLink(playerTarget).c_str(), itemId); + if (!playerTarget->HasItemCount(itemId, 0)) + { + // output that player don't have any items to destroy + handler->PSendSysMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId); + } + else if (!playerTarget->HasItemCount(itemId, -count)) + { + // output that player don't have as many items that you want to destroy + handler->PSendSysMessage(LANG_REMOVEITEM_ERROR, handler->GetNameLink(playerTarget).c_str(), itemId); + } } else { @@ -1561,14 +1565,6 @@ public: return true; } - /* [AC] Sunwell hack - if (handler->GetSession()->GetSecurity() < SEC_ADMINISTRATOR) - { - handler->PSendSysMessage("You may only remove items. Adding items is available for higher GMLevel."); - return false; - } - */ - // Adding items uint32 noSpaceForCount = 0;