mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Core/Commands): Fix removing item from player account (#11041)
The additem command would silently return when trying to remove an item from a player security level account
This commit is contained in:
@@ -1658,20 +1658,22 @@ public:
|
||||
{
|
||||
// output that player don't have any items to destroy
|
||||
handler->PSendSysMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
else if (!playerTarget->HasItemCount(itemId, -count))
|
||||
|
||||
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);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// output successful amount of destroyed items
|
||||
playerTarget->DestroyItemCount(itemId, -count, true, false);
|
||||
handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str());
|
||||
}
|
||||
|
||||
// output successful amount of destroyed items
|
||||
playerTarget->DestroyItemCount(itemId, -count, true, false);
|
||||
handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user