From e2301ecae7d7c76778430545c32e0e5e452eebe1 Mon Sep 17 00:00:00 2001 From: Quietust Date: Tue, 23 Jun 2020 13:31:27 -0600 Subject: [PATCH] Update structures, fix reaction_productst::produce() parms --- library/modules/Items.cpp | 4 ++-- library/xml | 2 +- plugins/add-spatter.cpp | 4 ++-- plugins/createitem.cpp | 4 ++-- plugins/diggingInvaders/assignJob.cpp | 4 ++-- plugins/eventful.cpp | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 05f174ddf..0e02043dc 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -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; diff --git a/library/xml b/library/xml index 6f7f33ceb..542d1bd28 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 6f7f33cebbbefefa7c6f920b2fc197b56a3e8d1c +Subproject commit 542d1bd283051186b2d4943c9acb546af1cc7b8b diff --git a/plugins/add-spatter.cpp b/plugins/add-spatter.cpp index 3d2d89dd1..459e28f25 100644 --- a/plugins/add-spatter.cpp +++ b/plugins/add-spatter.cpp @@ -249,7 +249,7 @@ struct product_hook : improvement_product { std::vector *in_reag, std::vector *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 *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); } }; diff --git a/plugins/createitem.cpp b/plugins/createitem.cpp index 939afebc2..4ef1c853c 100644 --- a/plugins/createitem.cpp +++ b/plugins/createitem.cpp @@ -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 diff --git a/plugins/diggingInvaders/assignJob.cpp b/plugins/diggingInvaders/assignJob.cpp index b253e7833..7e3dfaf8c 100644 --- a/plugins/diggingInvaders/assignJob.cpp +++ b/plugins/diggingInvaders/assignJob.cpp @@ -256,8 +256,8 @@ int32_t assignJob(color_ostream& out, Edge firstImportantEdge, unordered_map in_reag; vector 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()); diff --git a/plugins/eventful.cpp b/plugins/eventful.cpp index 5d8dfdb59..42cfbdf69 100644 --- a/plugins/eventful.cpp +++ b/plugins/eventful.cpp @@ -287,12 +287,12 @@ struct product_hook : item_product { std::vector *in_reag, std::vector *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 *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