Update structures, fix reaction_productst::produce() parms

develop
Quietust 2020-06-23 13:31:27 -06:00
parent 85855a2d88
commit e2301ecae7
6 changed files with 12 additions and 12 deletions

@ -1477,9 +1477,9 @@ int32_t Items::createItem(df::item_type item_type, int16_t item_subtype, int16_t
df::enums::game_type::game_type type = *df::global::gametype;
prod->produce(unit, &out_products, &out_items, &in_reag, &in_items, 1, job_skill::NONE,
df::historical_entity::find(unit->civ_id), 0,
0, df::historical_entity::find(unit->civ_id),
((type == df::enums::game_type::DWARF_MAIN) || (type == df::enums::game_type::DWARF_RECLAIM)) ? df::world_site::find(df::global::ui->site_id) : NULL,
0);
NULL);
if ( out_items.size() != 1 )
return -1;

@ -1 +1 @@
Subproject commit 6f7f33cebbbefefa7c6f920b2fc197b56a3e8d1c
Subproject commit 542d1bd283051186b2d4943c9acb546af1cc7b8b

@ -249,7 +249,7 @@ struct product_hook : improvement_product {
std::vector<df::reaction_reagent*> *in_reag,
std::vector<df::item*> *in_items,
int32_t quantity, df::job_skill skill,
df::historical_entity *entity, int32_t unk, df::world_site *site, void* unk2)
int32_t quality, df::historical_entity *entity, df::world_site *site, std::vector<void *> *unk2)
) {
if (auto product = products[this])
{
@ -295,7 +295,7 @@ struct product_hook : improvement_product {
return;
}
INTERPOSE_NEXT(produce)(unit, out_products, out_items, in_reag, in_items, quantity, skill, entity, unk, site, unk2);
INTERPOSE_NEXT(produce)(unit, out_products, out_items, in_reag, in_items, quantity, skill, quality, entity, site, unk2);
}
};

@ -86,8 +86,8 @@ bool makeItem (df::reaction_product_itemst *prod, df::unit *unit, bool second_it
building = df::building::find(dest_building);
prod->produce(unit, &out_products, &out_items, &in_reag, &in_items, 1, job_skill::NONE,
df::historical_entity::find(unit->civ_id), 0,
(World::isFortressMode()) ? df::world_site::find(ui->site_id) : NULL, 0);
0, df::historical_entity::find(unit->civ_id),
(World::isFortressMode()) ? df::world_site::find(ui->site_id) : NULL, NULL);
if (!out_items.size())
return false;
// if we asked to make shoes and we got twice as many as we asked, then we're okay

@ -256,8 +256,8 @@ int32_t assignJob(color_ostream& out, Edge firstImportantEdge, unordered_map<df:
vector<df::reaction_reagent*> in_reag;
vector<df::item*> in_items;
prod->produce(firstInvader, &out_products, &out_items, &in_reag, &in_items, 1, df::job_skill::NONE,
df::historical_entity::find(firstInvader->civ_id), 0,
df::world_site::find(df::global::ui->site_id), 0);
0, df::historical_entity::find(firstInvader->civ_id),
df::world_site::find(df::global::ui->site_id), NULL);
if ( out_items.size() != 1 ) {
out.print("%s, %d: wrong size: %zu.\n", __FILE__, __LINE__, out_items.size());

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