Skip to content

Commit

Permalink
Fix a problem where the block coordinates would sometimes not get cop…
Browse files Browse the repository at this point in the history
…ied.
  • Loading branch information
RosaryMala committed May 22, 2020
1 parent d0c030c commit 3db490e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/remotefortressreader/remotefortressreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3db490e

Please sign in to comment.