update for DFHack/df-structures#7dfea1f1d4e453b97d5529785701db46360596ce

develop
Ben Lubar 2020-06-29 16:16:44 -05:00
parent ee56d8157f
commit a9f219baf9
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
8 changed files with 16 additions and 16 deletions

@ -95,7 +95,7 @@ void Kitchen::denyPlantSeedCookery(t_materialIndex materialIndex)
{ {
ui->kitchen.item_types.push_back(item_type::SEEDS); ui->kitchen.item_types.push_back(item_type::SEEDS);
ui->kitchen.item_subtypes.push_back(organicSubtype); ui->kitchen.item_subtypes.push_back(organicSubtype);
ui->kitchen.mat_types.push_back(type->material_defs.type_seed); ui->kitchen.mat_types.push_back(type->material_defs.type[plant_material_def::seed]);
ui->kitchen.mat_indices.push_back(materialIndex); ui->kitchen.mat_indices.push_back(materialIndex);
ui->kitchen.exc_types.push_back(df::kitchen_exc_type::Cook); ui->kitchen.exc_types.push_back(df::kitchen_exc_type::Cook);
} }
@ -103,7 +103,7 @@ void Kitchen::denyPlantSeedCookery(t_materialIndex materialIndex)
{ {
ui->kitchen.item_types.push_back(item_type::PLANT); ui->kitchen.item_types.push_back(item_type::PLANT);
ui->kitchen.item_subtypes.push_back(organicSubtype); ui->kitchen.item_subtypes.push_back(organicSubtype);
ui->kitchen.mat_types.push_back(type->material_defs.type_basic_mat); ui->kitchen.mat_types.push_back(type->material_defs.type[plant_material_def::basic_mat]);
ui->kitchen.mat_indices.push_back(materialIndex); ui->kitchen.mat_indices.push_back(materialIndex);
ui->kitchen.exc_types.push_back(df::kitchen_exc_type::Cook); ui->kitchen.exc_types.push_back(df::kitchen_exc_type::Cook);
} }

@ -899,8 +899,8 @@ t_matpair MapExtras::BlockInfo::getBaseMaterial(df::tiletype tt, df::coord2d pos
{ {
if (auto raw = df::plant_raw::find(plant->material)) if (auto raw = df::plant_raw::find(plant->material))
{ {
rv.mat_type = raw->material_defs.type_basic_mat; rv.mat_type = raw->material_defs.type[plant_material_def::basic_mat];
rv.mat_index = raw->material_defs.idx_basic_mat; rv.mat_index = raw->material_defs.idx[plant_material_def::basic_mat];
} }
} }
break; break;
@ -912,8 +912,8 @@ t_matpair MapExtras::BlockInfo::getBaseMaterial(df::tiletype tt, df::coord2d pos
rv.mat_type = MaterialInfo::PLANT_BASE; rv.mat_type = MaterialInfo::PLANT_BASE;
if (auto raw = df::plant_raw::find(grass[x][y])) if (auto raw = df::plant_raw::find(grass[x][y]))
{ {
rv.mat_type = raw->material_defs.type_basic_mat; rv.mat_type = raw->material_defs.type[plant_material_def::basic_mat];
rv.mat_index = raw->material_defs.idx_basic_mat; rv.mat_index = raw->material_defs.idx[plant_material_def::basic_mat];
} }
break; break;

@ -261,7 +261,7 @@ bool MaterialInfo::findPlant(const std::string &token, const std::string &subtok
// As a special exception, return the structural material with empty subtoken // As a special exception, return the structural material with empty subtoken
if (subtoken.empty()) if (subtoken.empty())
return decode(p->material_defs.type_basic_mat, p->material_defs.idx_basic_mat); return decode(p->material_defs.type[plant_material_def::basic_mat], p->material_defs.idx[plant_material_def::basic_mat]);
for (size_t j = 0; j < p->material.size(); j++) for (size_t j = 0; j < p->material.size(); j++)
if (p->material[j]->id == subtoken) if (p->material[j]->id == subtoken)

@ -1 +1 @@
Subproject commit 97084e556119ce4445c3745151180467338a746a Subproject commit 7dfea1f1d4e453b97d5529785701db46360596ce

@ -258,7 +258,7 @@ static bool skip_plant(const df::plant * plant, bool *restricted)
const df::plant_raw *plant_raw = df::plant_raw::find(plant->material); const df::plant_raw *plant_raw = df::plant_raw::find(plant->material);
// Skip fruit trees if set. // Skip fruit trees if set.
if (skip.fruit_trees && plant_raw->material_defs.type_drink != -1) if (skip.fruit_trees && plant_raw->material_defs.type[plant_material_def::drink] != -1)
{ {
if (restricted) if (restricted)
*restricted = true; *restricted = true;

@ -70,7 +70,7 @@ enum class selectability {
//selectability selectablePlant(color_ostream &out, const df::plant_raw *plant, bool farming) //selectability selectablePlant(color_ostream &out, const df::plant_raw *plant, bool farming)
selectability selectablePlant(const df::plant_raw *plant, bool farming) selectability selectablePlant(const df::plant_raw *plant, bool farming)
{ {
const DFHack::MaterialInfo basic_mat = DFHack::MaterialInfo(plant->material_defs.type_basic_mat, plant->material_defs.idx_basic_mat); const DFHack::MaterialInfo basic_mat = DFHack::MaterialInfo(plant->material_defs.type[plant_material_def::basic_mat], plant->material_defs.idx[plant_material_def::basic_mat]);
bool outOfSeason = false; bool outOfSeason = false;
selectability result = selectability::Nonselectable; selectability result = selectability::Nonselectable;
@ -92,7 +92,7 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
return selectability::Grass; return selectability::Grass;
} }
if (farming && plant->material_defs.type_seed == -1) if (farming && plant->material_defs.type[plant_material_def::seed] == -1)
{ {
return selectability::Nonselectable; return selectability::Nonselectable;
} }
@ -163,8 +163,8 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
{ {
for (size_t k = 0; growth_mat.material->reaction_product.material.mat_type.size(); k++) 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->material_defs.type_seed && if (growth_mat.material->reaction_product.material.mat_type[k] == plant->material_defs.type[plant_material_def::seed] &&
growth_mat.material->reaction_product.material.mat_index[k] == plant->material_defs.idx_seed) growth_mat.material->reaction_product.material.mat_index[k] == plant->material_defs.idx[plant_material_def::seed])
{ {
seedSource = true; seedSource = true;
break; break;
@ -193,7 +193,7 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
} }
/* else if (plant->growths[i]->behavior.bits.has_seed) // This code designates beans, etc. when DF doesn't, but plant gatherers still fail to collect anything, so it's useless: bug #0006940. /* else if (plant->growths[i]->behavior.bits.has_seed) // This code designates beans, etc. when DF doesn't, but plant gatherers still fail to collect anything, so it's useless: bug #0006940.
{ {
const DFHack::MaterialInfo seed_mat = DFHack::MaterialInfo(plant->material_defs.type_seed, plant->material_defs.idx_seed); const DFHack::MaterialInfo seed_mat = DFHack::MaterialInfo(plant->material_defs.type[plant_material_def::seed], plant->material_defs.idx[plant_material_def::seed]);
if (seed_mat.material->flags.is_set(material_flags::EDIBLE_RAW) || if (seed_mat.material->flags.is_set(material_flags::EDIBLE_RAW) ||
seed_mat.material->flags.is_set(material_flags::EDIBLE_COOKED)) seed_mat.material->flags.is_set(material_flags::EDIBLE_COOKED))

@ -1 +1 @@
Subproject commit 5b7e7743a1372b929acb2ccb75080e139ac11691 Subproject commit bdab71c99a0a7cc268ca517a0cd3f0a5fb41042a

@ -1 +1 @@
Subproject commit 47d9b3c9390d21ecc49ddaba477b16071884ee87 Subproject commit 792ae44ab14afd3a2b3e850a6fcb463d714b0a44