Fix more produce() calls

develop
lethosor 2015-12-22 09:54:00 -05:00
parent 10c72a3d5d
commit c9eab65c96
4 changed files with 9 additions and 9 deletions

@ -244,7 +244,7 @@ struct product_hook : improvement_product {
DEFINE_VMETHOD_INTERPOSE(
void, produce,
(df::unit *unit,
std::vector<void*> *unk,
std::vector<df::reaction_product*> *out_products,
std::vector<df::item*> *out_items,
std::vector<df::reaction_reagent*> *in_reag,
std::vector<df::item*> *in_items,
@ -295,7 +295,7 @@ struct product_hook : improvement_product {
return;
}
INTERPOSE_NEXT(produce)(unit, unk, out_items, in_reag, in_items, quantity, skill, entity, site);
INTERPOSE_NEXT(produce)(unit, out_products, out_items, in_reag, in_items, quantity, skill, entity, site);
}
};

@ -70,10 +70,10 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out )
bool makeItem (df::reaction_product_itemst *prod, df::unit *unit, bool second_item = false)
{
vector<df::reaction_product*> out_products;
vector<df::item *> out_items;
vector<df::reaction_reagent *> in_reag;
vector<df::item *> in_items;
vector<void*> unk;
bool is_gloves = (prod->item_type == item_type::GLOVES);
bool is_shoes = (prod->item_type == item_type::SHOES);
@ -84,7 +84,7 @@ bool makeItem (df::reaction_product_itemst *prod, df::unit *unit, bool second_it
if (dest_building != -1)
building = df::building::find(dest_building);
prod->produce(unit, &unk, &out_items, &in_reag, &in_items, 1, job_skill::NONE,
prod->produce(unit, &out_products, &out_items, &in_reag, &in_items, 1, job_skill::NONE,
df::historical_entity::find(unit->civ_id),
(World::isFortressMode()) ? df::world_site::find(ui->site_id) : NULL);
if (!out_items.size())

@ -252,11 +252,11 @@ int32_t assignJob(color_ostream& out, Edge firstImportantEdge, unordered_map<df:
prod->count = 1;
prod->product_dimension = 1;
vector<df::reaction_product*> out_products;
vector<df::item*> out_items;
vector<df::reaction_reagent*> in_reag;
vector<df::item*> in_items;
vector<void*> unk;
prod->produce(firstInvader, &unk, &out_items, &in_reag, &in_items, 1, df::job_skill::NONE,
prod->produce(firstInvader, &out_products, &out_items, &in_reag, &in_items, 1, df::job_skill::NONE,
df::historical_entity::find(firstInvader->civ_id),
df::world_site::find(df::global::ui->site_id));

@ -310,7 +310,7 @@ struct product_hook : item_product {
DEFINE_VMETHOD_INTERPOSE(
void, produce,
(df::unit *unit,
std::vector<void*> *unk,
std::vector<df::reaction_product*> *out_products,
std::vector<df::item*> *out_items,
std::vector<df::reaction_reagent*> *in_reag,
std::vector<df::item*> *in_items,
@ -320,7 +320,7 @@ struct product_hook : item_product {
color_ostream_proxy out(Core::getInstance().getConsole());
auto product = products[this];
if ( !product ) {
INTERPOSE_NEXT(produce)(unit, unk, out_items, in_reag, in_items, quantity, skill, entity, site);
INTERPOSE_NEXT(produce)(unit, out_products, out_items, in_reag, in_items, quantity, skill, entity, site);
return;
}
df::reaction* this_reaction=product->react;
@ -331,7 +331,7 @@ struct product_hook : item_product {
return;
size_t out_item_count = out_items->size();
INTERPOSE_NEXT(produce)(unit, unk, out_items, in_reag, in_items, quantity, skill, entity, site);
INTERPOSE_NEXT(produce)(unit, out_products, out_items, in_reag, in_items, quantity, skill, entity, site);
if ( out_items->size() == out_item_count )
return;
//if it produced something, call the scripts