Fix crash when reporting item destroyed to master

This commit is contained in:
郑佩茹
2022-04-19 10:43:21 -06:00
parent e7c3b474d3
commit c9e8799392

View File

@@ -27,11 +27,11 @@ void DestroyItemAction::DestroyItem(FindItemVisitor* visitor)
std::vector<Item*> items = visitor->GetResult(); std::vector<Item*> items = visitor->GetResult();
for (Item* item : items) for (Item* item : items)
{ {
bot->DestroyItem(item->GetBagSlot(),item->GetSlot(), true);
std::ostringstream out; std::ostringstream out;
out << chat->FormatItem(item->GetTemplate()) << " destroyed"; out << chat->FormatItem(item->GetTemplate()) << " destroyed";
botAI->TellMaster(out); botAI->TellMaster(out);
bot->DestroyItem(item->GetBagSlot(),item->GetSlot(), true);
} }
} }