Skip to content

Commit

Permalink
Update getplants to use new plant_raw.material_defs layout
Browse files Browse the repository at this point in the history
a9f219b applied to #1564
  • Loading branch information
lethosor committed Aug 6, 2020
1 parent d3fc691 commit 02c0a6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/getplants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool picked(const df::plant *plant, int32_t growth_subtype) {

bool designate(const df::plant *plant, bool farming) {
df::plant_raw *plant_raw = world->raws.plants.all[plant->material];
const DFHack::MaterialInfo basic_mat = DFHack::MaterialInfo(plant_raw->material_defs.type_basic_mat, plant_raw->material_defs.idx_basic_mat);
const DFHack::MaterialInfo basic_mat = DFHack::MaterialInfo(plant_raw->material_defs.type[plant_material_def::basic_mat], plant_raw->material_defs.idx[plant_material_def::basic_mat]);

if (basic_mat.material->flags.is_set(material_flags::EDIBLE_RAW) ||
basic_mat.material->flags.is_set(material_flags::EDIBLE_COOKED))
Expand Down Expand Up @@ -309,8 +309,8 @@ bool designate(const df::plant *plant, bool farming) {
{
for (size_t k = 0; growth_mat.material->reaction_product.material.mat_type.size(); k++)
{
if (growth_mat.material->reaction_product.material.mat_type[k] == plant_raw->material_defs.type_seed &&
growth_mat.material->reaction_product.material.mat_index[k] == plant_raw->material_defs.idx_seed)
if (growth_mat.material->reaction_product.material.mat_type[k] == plant_raw->material_defs.type[plant_material_def::seed] &&
growth_mat.material->reaction_product.material.mat_index[k] == plant_raw->material_defs.idx[plant_material_def::seed])
{
seedSource = true;
break;
Expand Down

0 comments on commit 02c0a6c

Please sign in to comment.