Merge pull request #1223 from JapaMala/remote_control

Remote control
develop
Lethosor 2018-02-21 23:04:53 -05:00 committed by GitHub
commit 800dde360d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

@ -99,6 +99,13 @@ void CopyImage(const df::art_image * image, ArtImage * netImage)
it->set_mat_type(item->item_type);
it->set_mat_index(item->item_subtype);
netElement->set_id(item->item_id);
switch (item->item_type)
{
case item_type::PLANT:
it->set_mat_index(item->mat_index);
default:
break;
}
auto mat = netElement->mutable_material();
mat->set_mat_type(item->mat_type);
mat->set_mat_index(item->mat_index);
@ -303,6 +310,8 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem)
case df::enums::item_type::SEEDS:
break;
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;
case df::enums::item_type::SKIN_TANNED:
break;
@ -521,6 +530,18 @@ DFHack::command_result GetItemList(DFHack::color_ostream &stream, const DFHack::
}
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:
{
mat_def = out->add_material_list();

@ -1511,9 +1511,9 @@ static command_result GetBlockList(color_ostream &stream, const BlockRequest *in
auto engraving = world->engravings[i];
if (engraving->pos.x < (min_x * 16) || engraving->pos.x >(max_x * 16))
continue;
if (engraving->pos.y < (min_y * 16) || engraving->pos.x >(max_y * 16))
if (engraving->pos.y < (min_y * 16) || engraving->pos.y >(max_y * 16))
continue;
if (engraving->pos.z < (min_z * 16) || engraving->pos.x >(max_z * 16))
if (engraving->pos.z < min_z || engraving->pos.z > max_z)
continue;
if (!isEngravingNew(i))
continue;