Make can_trade() return true if at least one caravan can trade

Fixes #900
develop
lethosor 2016-04-16 17:13:00 -04:00
parent 0d37209063
commit 8226134f67
2 changed files with 4 additions and 3 deletions

@ -84,6 +84,7 @@ Fixes
- More plugins should recognize non-dwarf citizens
- Fixed a possible crash from cloning jobs
- moveToBuilding() now sets flags for items that aren't a structural part of the building properly
- `autotrade`, `stocks`: Made trading work when multiple caravans are present but only some can trade
- `confirm` note-delete: No longer interferes with name entry
- `exportlegends`: Handles entities without specific races, and a few other fixes for things new to v0.42
- `fastdwarf`: Fixed a bug involving teleporting mothers but not the babies they're holding.

@ -263,11 +263,11 @@ static bool can_trade()
auto caravan = *it;
auto trade_state = caravan->trade_state;
auto time_remaining = caravan->time_remaining;
if ((trade_state != state::Approaching && trade_state != state::AtDepot) || time_remaining == 0)
return false;
if ((trade_state == state::Approaching || trade_state == state::AtDepot) && time_remaining != 0)
return true;
}
return true;
return false;
}
static bool is_metal_item(df::item *item)