Include plant type with plant items.

develop
Japa 2018-02-21 22:27:04 +05:30
parent 1c97f58340
commit 8c20d178b5
1 changed files with 14 additions and 0 deletions

@ -303,6 +303,8 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem)
case df::enums::item_type::SEEDS: case df::enums::item_type::SEEDS:
break; break;
case df::enums::item_type::PLANT: case df::enums::item_type::PLANT:
//For convenience, we encode the plant type into item type, even if it's available in the material.
type->set_mat_index(DfItem->getMaterialIndex());
break; break;
case df::enums::item_type::SKIN_TANNED: case df::enums::item_type::SKIN_TANNED:
break; break;
@ -521,6 +523,18 @@ DFHack::command_result GetItemList(DFHack::color_ostream &stream, const DFHack::
} }
break; break;
} }
case df::enums::item_type::PLANT:
{
for (int i = 0; i < world->raws.plants.all.size(); i++)
{
auto plantRaw = world->raws.plants.all[i];
mat_def = out->add_material_list();
mat_def->mutable_mat_pair()->set_mat_type((int)it);
mat_def->mutable_mat_pair()->set_mat_index(plantRaw->index);
mat_def->set_id(ENUM_KEY_STR(item_type, it) + "/" + plantRaw->id);
}
break;
}
case df::enums::item_type::BOX: case df::enums::item_type::BOX:
{ {
mat_def = out->add_material_list(); mat_def = out->add_material_list();