Merge branch 'develop' of gh:DFHack/dfhack into develop

develop
lethosor 2020-06-29 23:03:48 -04:00
commit 115d100f2a
11 changed files with 21 additions and 19 deletions

@ -95,7 +95,7 @@ void Kitchen::denyPlantSeedCookery(t_materialIndex materialIndex)
{
ui->kitchen.item_types.push_back(item_type::SEEDS);
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.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_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.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))
{
rv.mat_type = raw->material_defs.type_basic_mat;
rv.mat_index = raw->material_defs.idx_basic_mat;
rv.mat_type = raw->material_defs.type[plant_material_def::basic_mat];
rv.mat_index = raw->material_defs.idx[plant_material_def::basic_mat];
}
}
break;
@ -912,8 +912,8 @@ t_matpair MapExtras::BlockInfo::getBaseMaterial(df::tiletype tt, df::coord2d pos
rv.mat_type = MaterialInfo::PLANT_BASE;
if (auto raw = df::plant_raw::find(grass[x][y]))
{
rv.mat_type = raw->material_defs.type_basic_mat;
rv.mat_index = raw->material_defs.idx_basic_mat;
rv.mat_type = raw->material_defs.type[plant_material_def::basic_mat];
rv.mat_index = raw->material_defs.idx[plant_material_def::basic_mat];
}
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
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++)
if (p->material[j]->id == subtoken)

@ -1 +1 @@
Subproject commit 97084e556119ce4445c3745151180467338a746a
Subproject commit b67b3fa4b02f834dc76a2e1eae21136e0be089f7

@ -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);
// 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)
*restricted = true;

@ -70,7 +70,7 @@ enum class selectability {
//selectability selectablePlant(color_ostream &out, 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;
selectability result = selectability::Nonselectable;
@ -92,7 +92,7 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
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;
}
@ -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++)
{
if (growth_mat.material->reaction_product.material.mat_type[k] == plant->material_defs.type_seed &&
growth_mat.material->reaction_product.material.mat_index[k] == plant->material_defs.idx_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[plant_material_def::seed])
{
seedSource = true;
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.
{
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) ||
seed_mat.material->flags.is_set(material_flags::EDIBLE_COOKED))

@ -2032,7 +2032,9 @@ void viewscreen_unitlaborsst::render()
int x = 1, y = 3 + num_rows + 2;
Screen::Pen white_pen(' ', 15, 0);
Screen::paintString(white_pen, x, y, (cur->unit && cur->unit->sex) ? "\x0b" : "\x0c");
auto symbol = cur->unit ? ENUM_ATTR(pronoun_type, symbol, cur->unit->sex) : nullptr;
if (symbol)
Screen::paintString(white_pen, x, y, symbol);
x += 2;
Screen::paintString(white_pen, x, y, cur->transname);
x += cur->transname.length();

@ -2685,7 +2685,7 @@ static command_result GetPartialCreatureRaws(color_ostream &stream, const ListRe
send_caste->add_child_name(orig_caste->child_name[0]);
send_caste->add_child_name(orig_caste->child_name[1]);
send_caste->set_gender(orig_caste->gender);
send_caste->set_gender(orig_caste->sex);
for (size_t partIndex = 0; partIndex < orig_caste->body_info.body_parts.size(); partIndex++)
{

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

@ -20,7 +20,7 @@ struct pet_gender_hook : df::viewscreen_topicmeeting_takerequestsst {
vector<int16_t>& castes = entity->resources.animals.pet_castes;
for (int i = (good_idx / 17) * 17, y = 4; i < (good_idx / 17) * 17 + 17 && size_t(i) < races.size(); i++, y++) {
int x = 30 + 1 + world->raws.creatures.all[races[i]]->caste[castes[i]]->caste_name[0].size();
bool male = (bool)world->raws.creatures.all[races[i]]->caste[castes[i]]->gender;
bool male = world->raws.creatures.all[races[i]]->caste[castes[i]]->sex == pronoun_type::he;
OutputString((i == good_idx) ? COLOR_WHITE : COLOR_GREY,
x, y, male ? "\013" : "\014");
}

@ -1 +1 @@
Subproject commit 47d9b3c9390d21ecc49ddaba477b16071884ee87
Subproject commit 3987d031469420d64aff23097d9548676f1ab752