From 894f6c232b406048602b4cbd27ab1f5d66c6bb70 Mon Sep 17 00:00:00 2001 From: Japa Mala Illo Date: Sat, 3 Mar 2018 12:48:09 +0530 Subject: [PATCH] actually copy flows with the block this time. --- .../remotefortressreader.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 5b8cf89d5..6876866fc 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -1466,7 +1466,7 @@ static command_result GetBlockList(color_ostream &stream, const BlockRequest *in df::map_block * block = DFHack::Maps::getBlock(pos); if (block != NULL) { - int nonAir = 0; + bool nonAir = false; for (int xxx = 0; xxx < 16; xxx++) for (int yyy = 0; yyy < 16; yyy++) { @@ -1474,16 +1474,23 @@ static command_result GetBlockList(color_ostream &stream, const BlockRequest *in DFHack::tileShapeBasic(DFHack::tileShape(block->tiletype[xxx][yyy])) != df::tiletype_shape_basic::Open) || block->designation[xxx][yyy].bits.flow_size > 0 || block->occupancy[xxx][yyy].bits.building > 0) - nonAir++; + { + nonAir = true; + goto ItsAir; + } } - if (nonAir > 0 || firstBlock) + ItsAir: + if (block->flows.size() > 0) + nonAir = true; + if (nonAir || firstBlock) { bool tileChanged = IsTiletypeChanged(pos); bool desChanged = IsDesignationChanged(pos); bool spatterChanged = IsspatterChanged(pos); bool itemsChanged = block->items.size() > 0; + bool flows = block->flows.size() > 0; RemoteFortressReader::MapBlock *net_block; - if (tileChanged || desChanged || spatterChanged || firstBlock || itemsChanged) + if (tileChanged || desChanged || spatterChanged || firstBlock || itemsChanged || flows) net_block = out->add_map_blocks(); if (tileChanged) { @@ -1502,6 +1509,10 @@ static command_result GetBlockList(color_ostream &stream, const BlockRequest *in Copyspatters(block, net_block, &MC, pos); if (itemsChanged) CopyItems(block, net_block, &MC, pos); + if (flows) + { + CopyFlows(block, net_block); + } } } }