From 60853a543df9e5a90f71f9b315e7169211a126b2 Mon Sep 17 00:00:00 2001 From: JapaMala Date: Sat, 2 May 2020 13:28:28 -0700 Subject: [PATCH 1/4] Remove the site realization building type from the remote reader spec. It has no business being there. --- plugins/proto/RemoteFortressReader.proto | 29 +------------------ .../remotefortressreader.cpp | 2 +- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index a54a0397f..864cdba1a 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -642,33 +642,6 @@ message WorldMap repeated RegionTile region_tiles = 25; } -enum SiteRealizationBuildingType -{ - cottage_plot = 0; - castle_wall = 1; - castle_tower = 2; - castle_courtyard = 3; - house = 4; - temple = 5; - tomb = 6; - shop_house = 7; - warehouse = 8; - market_square = 9; - pasture = 10; - waste = 11; - courtyard = 12; - well = 13; - vault = 14; - great_tower = 15; - trenches = 16; - tree_house = 17; - hillock_house = 18; - mead_hall = 19; - fortress_entrance = 20; - library = 21; - tavern = 22; -} - message SiteRealizationBuildingWall { optional int32 start_x = 1; @@ -702,7 +675,6 @@ message SiteRealizationBuildingTrenches message SiteRealizationBuilding { optional int32 id = 1; - optional SiteRealizationBuildingType type = 2; optional int32 min_x = 3; optional int32 min_y = 4; optional int32 max_x = 5; @@ -711,6 +683,7 @@ message SiteRealizationBuilding optional SiteRealizationBuildingWall wall_info = 8; optional SiteRealizationBuildingTower tower_info = 9; optional SiteRealizationBuildingTrenches trench_info = 10; + optional int32 type = 11; } message RegionTile diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index e94c3f832..7e654c727 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -2541,7 +2541,7 @@ static void CopyLocalMap(df::world_data * worldData, df::world_region_details* w out_building->set_id(in_building->id); #if DF_VERSION_INT > 34011 - out_building->set_type((SiteRealizationBuildingType)in_building->type); + out_building->set_type(in_building->type); #endif out_building->set_min_x(in_building->min_x - (site_x * 48)); out_building->set_min_y(in_building->min_y - (site_y * 48)); From 63c7b69b5b5a9503b378185bf56b768e1c740d51 Mon Sep 17 00:00:00 2001 From: JapaMala Date: Sat, 2 May 2020 14:38:55 -0700 Subject: [PATCH 2/4] Change item improvement type to bare ints. --- plugins/proto/RemoteFortressReader.proto | 19 +------------------ plugins/remotefortressreader/item_reader.cpp | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index 864cdba1a..8255f91cd 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -963,30 +963,13 @@ message Language repeated ShapeDescriptior shapes = 1; } -enum ImprovementType -{ - ART_IMAGE = 0; - COVERED = 1; - RINGS_HANGING = 2; - BANDS = 3; - SPIKES = 4; - ITEMSPECIFIC = 5; - THREAD = 6; - CLOTH = 7; - SEWN_IMAGE = 8; - PAGES = 9; - ILLUSTRATION = 10; - INSTRUMENT_PIECE = 11; - WRITING = 12; -} - message ItemImprovement { optional MatPair material = 1; - optional ImprovementType type = 2; optional int32 shape = 3; optional int32 specific_type= 4; optional ArtImage image = 5; + optional int32 type = 6; } enum ArtImageElementType diff --git a/plugins/remotefortressreader/item_reader.cpp b/plugins/remotefortressreader/item_reader.cpp index 620e06310..56ec9019b 100644 --- a/plugins/remotefortressreader/item_reader.cpp +++ b/plugins/remotefortressreader/item_reader.cpp @@ -450,7 +450,7 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem) auto netImp = NetItem->add_improvements(); - netImp->set_type((ImprovementType)impType); + netImp->set_type(impType); auto mat = netImp->mutable_material(); mat->set_mat_type(improvement->mat_type); From 3db490ee9e31c7a0f950f242b8c338a161a63fcc Mon Sep 17 00:00:00 2001 From: Rose Date: Fri, 22 May 2020 08:01:34 -0700 Subject: [PATCH 3/4] Fix a problem where the block coordinates would sometimes not get copied. --- plugins/remotefortressreader/remotefortressreader.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index e94c3f832..8e9ac8d45 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -949,9 +949,6 @@ static command_result GetGrowthList(color_ostream &stream, const EmptyMessage *i void CopyBlock(df::map_block * DfBlock, RemoteFortressReader::MapBlock * NetBlock, MapExtras::MapCache * MC, DFCoord pos) { - NetBlock->set_map_x(DfBlock->map_pos.x); - NetBlock->set_map_y(DfBlock->map_pos.y); - NetBlock->set_map_z(DfBlock->map_pos.z); MapExtras::Block * block = MC->BlockAtTile(DfBlock->map_pos); @@ -1465,7 +1462,12 @@ static command_result GetBlockList(color_ostream &stream, const BlockRequest *in bool flows = block->flows.size() > 0; RemoteFortressReader::MapBlock *net_block = nullptr; if (tileChanged || desChanged || spatterChanged || firstBlock || itemsChanged || flows) + { net_block = out->add_map_blocks(); + net_block->set_map_x(block->map_pos.x); + net_block->set_map_y(block->map_pos.y); + net_block->set_map_z(block->map_pos.z); + } if (tileChanged) { CopyBlock(block, net_block, &MC, pos); From ad3735421186f56e2097e8324610b9aa77969722 Mon Sep 17 00:00:00 2001 From: Rose Date: Sun, 24 May 2020 15:42:59 -0700 Subject: [PATCH 4/4] Bump version number to make sure the updater works. --- plugins/remotefortressreader/remotefortressreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 4ab540a5e..5a8957ddf 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -1,5 +1,5 @@ #include "df_version_int.h" -#define RFR_VERSION "0.20.3" +#define RFR_VERSION "0.21.0" #include #include