MCPcopy Create free account
hub / github.com/DFHack/dfhack / can_trade

Function can_trade

plugins/uicommon.h:198–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 */
197
198static inline bool can_trade()
199{
200 if (df::global::plotinfo->caravans.size() == 0)
201 return false;
202
203 for (auto it = df::global::plotinfo->caravans.begin(); it != df::global::plotinfo->caravans.end(); it++)
204 {
205 typedef df::caravan_state::T_trade_state state;
206 auto caravan = *it;
207 auto trade_state = caravan->trade_state;
208 auto time_remaining = caravan->time_remaining;
209 if ((trade_state == state::Approaching || trade_state == state::AtDepot) && time_remaining != 0)
210 return true;
211 }
212
213 return false;
214}
215
216static inline bool is_metal_item(df::item *item)
217{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected