fix(Script/Command): HandleAddItemCommand (#5412)

* fix(Core/Command): Additem

* Update cs_misc.cpp
This commit is contained in:
Kitzunu
2021-05-01 17:07:15 +02:00
committed by GitHub
parent 52f6f2f15b
commit 46c9aa6f3a

View File

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