Merge pull request #192 from oiuv/dev

Modify command `s` to prevent the accidental sale of all items
This commit is contained in:
Yunfan Li 2024-04-16 21:59:38 +08:00 committed by GitHub
commit 946549990a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,13 +74,18 @@ bool SellAction::Execute(Event event)
return true; return true;
} }
std::vector<Item*> items = parseItems(text, ITERATE_ITEMS_IN_BAGS); if (text == "all")
for (Item* item : items) {
std::vector<Item *> items = parseItems(text, ITERATE_ITEMS_IN_BAGS);
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)