Fix a problem where the block coordinates would sometimes not get copied.

develop
Rose 2020-05-22 08:01:34 -07:00
parent d0c030c3da
commit 3db490ee9e
1 changed files with 5 additions and 3 deletions

@ -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);