@ -754,7 +754,12 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
df : : building_tradedepotst * depot = ( df : : building_tradedepotst * ) build ;
df : : building_tradedepotst * depot = ( df : : building_tradedepotst * ) build ;
trader_requested = depot - > trade_flags . bits . trader_requested ;
trader_requested = depot - > trade_flags . bits . trader_requested ;
if ( print_debug )
if ( print_debug )
{
if ( trader_requested )
out . print ( " Trade depot found and trader requested, trader will be excluded from all labors. \n " ) ;
out . print ( " Trade depot found and trader requested, trader will be excluded from all labors. \n " ) ;
else
out . print ( " Trade depot found but trader is not requested. \n " ) ;
}
}
}
}
}
@ -1016,6 +1021,8 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
continue ;
continue ;
if ( dwarf_info [ dwarf ] . state = = MILITARY )
if ( dwarf_info [ dwarf ] . state = = MILITARY )
continue ;
continue ;
if ( dwarf_info [ dwarf ] . trader & & trader_requested )
continue ;
if ( labor_infos [ labor ] . is_exclusive & & dwarf_info [ dwarf ] . has_exclusive_labor )
if ( labor_infos [ labor ] . is_exclusive & & dwarf_info [ dwarf ] . has_exclusive_labor )
continue ;
continue ;
@ -1142,7 +1149,7 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
}
}
if ( print_debug )
if ( print_debug )
out . print ( " Dwarf %i \" %s \" assigned %s: value %i \n %s " , dwarf , dwarfs [ dwarf ] - > name . first_name . c_str ( ) , ENUM_KEY_STR ( unit_labor , labor ) . c_str ( ) , values [ dwarf ] , dwarf_info [ dwarf ] . trader ? " (trader) " : " " ) ;
out . print ( " Dwarf %i \" %s \" assigned %s: value %i %s \n " , dwarf , dwarfs [ dwarf ] - > name . first_name . c_str ( ) , ENUM_KEY_STR ( unit_labor , labor ) . c_str ( ) , values [ dwarf ] , dwarf_info [ dwarf ] . trader ? " (trader) " : " " ) ;
if ( dwarf_info [ dwarf ] . state = = IDLE | | dwarf_info [ dwarf ] . state = = BUSY )
if ( dwarf_info [ dwarf ] . state = = IDLE | | dwarf_info [ dwarf ] . state = = BUSY )
labor_infos [ labor ] . active_dwarfs + + ;
labor_infos [ labor ] . active_dwarfs + + ;
@ -1164,7 +1171,18 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
for ( int dwarf = 0 ; dwarf < n_dwarfs ; dwarf + + )
for ( int dwarf = 0 ; dwarf < n_dwarfs ; dwarf + + )
{
{
if ( dwarf_info [ dwarf ] . trader & & trader_requested )
if ( dwarf_info [ dwarf ] . trader & & trader_requested )
{
FOR_ENUM_ITEMS ( unit_labor , labor )
{
if ( labor = = df : : enums : : unit_labor : : NONE )
continue ;
if ( labor_infos [ labor ] . mode ( ) ! = HAULERS )
continue ;
dwarfs [ dwarf ] - > status . labors [ labor ] = false ;
}
continue ;
continue ;
}
if ( dwarf_info [ dwarf ] . state = = IDLE | | dwarf_info [ dwarf ] . state = = BUSY )
if ( dwarf_info [ dwarf ] . state = = IDLE | | dwarf_info [ dwarf ] . state = = BUSY )
hauler_ids . push_back ( dwarf ) ;
hauler_ids . push_back ( dwarf ) ;
}
}