diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index fe4ea1266..d6b9bbd8e 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -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; }