use trade_state enum

develop
lethosor 2016-04-13 09:44:57 -04:00
parent 3ab963499a
commit 0d37209063
2 changed files with 3 additions and 2 deletions

@ -1 +1 @@
Subproject commit 9b58faa3489a1058dfbfe90b94645ebdb1dafba5 Subproject commit 58806dc7e4bfcc1bb5f33b15395bdc9fd5a1ea28

@ -259,10 +259,11 @@ static bool can_trade()
for (auto it = df::global::ui->caravans.begin(); it != df::global::ui->caravans.end(); it++) for (auto it = df::global::ui->caravans.begin(); it != df::global::ui->caravans.end(); it++)
{ {
typedef df::caravan_state::T_trade_state state;
auto caravan = *it; auto caravan = *it;
auto trade_state = caravan->trade_state; auto trade_state = caravan->trade_state;
auto time_remaining = caravan->time_remaining; auto time_remaining = caravan->time_remaining;
if ((trade_state != 1 && trade_state != 2) || time_remaining == 0) if ((trade_state != state::Approaching && trade_state != state::AtDepot) || time_remaining == 0)
return false; return false;
} }