Modify command s to prevent the accidental sale of all items

This commit is contained in:
Oiuv
2024-04-16 19:22:00 +08:00
committed by Yunfan Li
parent 0629c106ae
commit 248bf6c003

View File

@@ -74,15 +74,20 @@ bool SellAction::Execute(Event event)
return true; return true;
} }
if (text == "all")
{
std::vector<Item *> items = parseItems(text, ITERATE_ITEMS_IN_BAGS); std::vector<Item *> items = parseItems(text, ITERATE_ITEMS_IN_BAGS);
for (Item *item : items) for (Item *item : items)
{ {
Sell(item); Sell(item);
} }
return true; return true;
} }
botAI->TellError("Usage: s gray/*/vendor/all");
return false;
}
void SellAction::Sell(FindItemVisitor* visitor) void SellAction::Sell(FindItemVisitor* visitor)
{ {
IterateItems(visitor); IterateItems(visitor);