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
+12 -16
View File
@@ -1541,15 +1541,19 @@ public:
// Subtract // Subtract
if (count < 0) 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 if (!playerTarget->HasItemCount(itemId, 0))
handler->PSendSysMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId); {
} // output that player don't have any items to destroy
else if (!playerTarget->HasItemCount(itemId, -count)) handler->PSendSysMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId);
{ }
// output that player don't have as many items that you want to destroy else if (!playerTarget->HasItemCount(itemId, -count))
handler->PSendSysMessage(LANG_REMOVEITEM_ERROR, handler->GetNameLink(playerTarget).c_str(), itemId); {
// 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 else
{ {
@@ -1561,14 +1565,6 @@ public:
return true; 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 // Adding items
uint32 noSpaceForCount = 0; uint32 noSpaceForCount = 0;