|
|
@ -316,8 +316,6 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re
|
|
|
|
material->set_mat_index(local_build->mat_index);
|
|
|
|
material->set_mat_index(local_build->mat_index);
|
|
|
|
|
|
|
|
|
|
|
|
remote_build->set_building_flags(local_build->flags.whole);
|
|
|
|
remote_build->set_building_flags(local_build->flags.whole);
|
|
|
|
//FIXME: Figure out what to replace this with.
|
|
|
|
|
|
|
|
//remote_build->set_is_room(local_build->is_room);
|
|
|
|
|
|
|
|
if (local_build->room.width > 0 && local_build->room.height > 0 && local_build->room.extents != nullptr)
|
|
|
|
if (local_build->room.width > 0 && local_build->room.height > 0 && local_build->room.extents != nullptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto room = remote_build->mutable_room();
|
|
|
|
auto room = remote_build->mutable_room();
|
|
|
@ -609,28 +607,29 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re
|
|
|
|
case df::enums::building_type::ArcheryTarget:
|
|
|
|
case df::enums::building_type::ArcheryTarget:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//FIXME: Need to decode archery targets again.
|
|
|
|
//FIXME: Need to decode archery targets again.
|
|
|
|
//auto actual = strict_virtual_cast<df::building_archerytargetst>(local_build);
|
|
|
|
auto actual = strict_virtual_cast<df::building_archerytargetst>(local_build);
|
|
|
|
//if (actual)
|
|
|
|
if (actual)
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// auto facing = actual->archery_direction;
|
|
|
|
for (size_t i = 0; i < actual->relations.size(); i++)
|
|
|
|
// switch (facing)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
if (actual->relations[i]->getType() != df::enums::building_type::Civzone)
|
|
|
|
// case df::building_archerytargetst::TopToBottom:
|
|
|
|
continue;
|
|
|
|
// remote_build->set_direction(NORTH);
|
|
|
|
auto zone = strict_virtual_cast<df::building_civzonest>(actual->relations[i]);
|
|
|
|
// break;
|
|
|
|
if (!zone)
|
|
|
|
// case df::building_archerytargetst::BottomToTop:
|
|
|
|
continue;
|
|
|
|
// remote_build->set_direction(SOUTH);
|
|
|
|
if (zone->type != df::civzone_type::ArcheryRange)
|
|
|
|
// break;
|
|
|
|
continue;
|
|
|
|
// case df::building_archerytargetst::LeftToRight:
|
|
|
|
if(zone->dir_x < 0)
|
|
|
|
// remote_build->set_direction(WEST);
|
|
|
|
remote_build->set_direction(EAST);
|
|
|
|
// break;
|
|
|
|
else if(zone->dir_x > 0)
|
|
|
|
// case df::building_archerytargetst::RightToLeft:
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
// remote_build->set_direction(EAST);
|
|
|
|
else if (zone->dir_y < 0)
|
|
|
|
// break;
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
// default:
|
|
|
|
else if (zone->dir_y > 0)
|
|
|
|
// break;
|
|
|
|
remote_build->set_direction(NORTH);
|
|
|
|
// }
|
|
|
|
break;
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case df::enums::building_type::Chain:
|
|
|
|
case df::enums::building_type::Chain:
|
|
|
@ -851,7 +850,6 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re
|
|
|
|
auto actual = strict_virtual_cast<df::building_windmillst>(local_build);
|
|
|
|
auto actual = strict_virtual_cast<df::building_windmillst>(local_build);
|
|
|
|
if (actual)
|
|
|
|
if (actual)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if DF_VERSION_INT > 34011
|
|
|
|
|
|
|
|
if (actual->orient_x < 0)
|
|
|
|
if (actual->orient_x < 0)
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
else if (actual->orient_x > 0)
|
|
|
|
else if (actual->orient_x > 0)
|
|
|
@ -861,7 +859,6 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re
|
|
|
|
else if (actual->orient_y > 0)
|
|
|
|
else if (actual->orient_y > 0)
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
remote_build->set_direction(SOUTH);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
remote_build->set_direction(WEST);
|
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
if (actual->machine.machine_id >= 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|