From 0d372090635417b4f3338032d5ccf587cc662c9f Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 13 Apr 2016 09:44:57 -0400 Subject: [PATCH] use trade_state enum --- library/xml | 2 +- plugins/uicommon.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/xml b/library/xml index 9b58faa34..58806dc7e 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 9b58faa3489a1058dfbfe90b94645ebdb1dafba5 +Subproject commit 58806dc7e4bfcc1bb5f33b15395bdc9fd5a1ea28 diff --git a/plugins/uicommon.h b/plugins/uicommon.h index 156552504..c2bb7d464 100644 --- a/plugins/uicommon.h +++ b/plugins/uicommon.h @@ -259,10 +259,11 @@ static bool can_trade() 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 trade_state = caravan->trade_state; 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; }