690
std::string TradeInstance::check_illegal() const {
691
if (num_batches > kMaxWaresPerBatch) {
692
return format("Too many batches (found %d, limit %d)", num_batches, kMaxWaresPerBatch);
694
if (num_batches < 1 && num_batches != kInfiniteTrade) {
695
return format("Bad number of batches %d", num_batches);
699
for (const WareAmount& pair : items_to_send) {
700
if (pair.second < 1 || pair.second > kMaxWaresPerBatch) {
701
return format("Sending %u items of ware %d", pair.second, pair.first);
706
return "Not sending any items";
708
if (c > kMaxWaresPerBatch) {
709
return format("Sending too many items (found %d, limit %d)", c, kMaxWaresPerBatch);
713
for (const WareAmount& pair : items_to_receive) {
714
if (pair.second < 1 || pair.second > kMaxWaresPerBatch) {
715
return format("Receiving %u items of ware %d", pair.second, pair.first);
720
return "Not receiving any items";
722
if (c > kMaxWaresPerBatch) {
723
return format("Receiving too many items (found %d, limit %d)", c, kMaxWaresPerBatch);
726
return std::string();
690
729
std::string TradeInstance::format_richtext(const TradeID id,
691
730
const EditorGameBase& egbase,
692
731
const PlayerNumber iplayer,