From 3db490ee9e31c7a0f950f242b8c338a161a63fcc Mon Sep 17 00:00:00 2001 From: Rose Date: Fri, 22 May 2020 08:01:34 -0700 Subject: [PATCH] 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);