Send building items and items kept in buildings separately.

develop
Japa Illo 2017-03-30 16:23:14 +05:30
parent 7c626ba3c2
commit 06225dd896
1 changed files with 12 additions and 4 deletions

@ -1170,10 +1170,17 @@ void CopyBuildings(df::map_block * DfBlock, RemoteFortressReader::MapBlock * Net
continue;
auto out_bld = NetBlock->add_buildings();
CopyBuilding(i, out_bld);
df::building_actual* actualBuilding = strict_virtual_cast<df::building_actual>(bld);
df::building_actual* actualBuilding = virtual_cast<df::building_actual>(bld);
if (actualBuilding)
{
for (int i = 0; i < actualBuilding->contained_items.size(); i++)
{
if (actualBuilding->contained_items[i]->use_mode == 0)
{
if (isItemChanged(actualBuilding->contained_items[i]->item->id))
CopyItem(NetBlock->add_items(), actualBuilding->contained_items[i]->item);
}
else
{
auto buildingItem = out_bld->add_items();
buildingItem->set_mode(actualBuilding->contained_items[i]->use_mode);
@ -1181,6 +1188,7 @@ void CopyBuildings(df::map_block * DfBlock, RemoteFortressReader::MapBlock * Net
}
}
}
}
}
void Copyspatters(df::map_block * DfBlock, RemoteFortressReader::MapBlock * NetBlock, MapExtras::MapCache * MC, DFCoord pos)