|  |  |  | @ -24,6 +24,7 @@ | 
		
	
		
			
				|  |  |  |  | #include "df/builtin_mats.h" | 
		
	
		
			
				|  |  |  |  | #include "df/map_block_column.h" | 
		
	
		
			
				|  |  |  |  | #include "df/plant.h" | 
		
	
		
			
				|  |  |  |  | #include "df/plant_raw_flags.h" | 
		
	
		
			
				|  |  |  |  | #if DF_VERSION > 40001 | 
		
	
		
			
				|  |  |  |  | #include "df/plant_tree_info.h" | 
		
	
		
			
				|  |  |  |  | #include "df/plant_tree_tile.h" | 
		
	
	
		
			
				
					|  |  |  | @ -112,6 +113,7 @@ static command_result GetWorldMap(color_ostream &stream, const EmptyMessage *in, | 
		
	
		
			
				|  |  |  |  | static command_result GetWorldMapCenter(color_ostream &stream, const EmptyMessage *in, WorldMap *out); | 
		
	
		
			
				|  |  |  |  | static command_result GetRegionMaps(color_ostream &stream, const EmptyMessage *in, RegionMaps *out); | 
		
	
		
			
				|  |  |  |  | static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage *in, CreatureRawList *out); | 
		
	
		
			
				|  |  |  |  | static command_result GetPlantRaws(color_ostream &stream, const EmptyMessage *in, PlantRawList *out); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | void CopyBlock(df::map_block * DfBlock, RemoteFortressReader::MapBlock * NetBlock, MapExtras::MapCache * MC, DFCoord pos); | 
		
	
	
		
			
				
					|  |  |  | @ -164,6 +166,7 @@ DFhackCExport RPCService *plugin_rpcconnect(color_ostream &) | 
		
	
		
			
				|  |  |  |  |     svc->addFunction("GetRegionMaps", GetRegionMaps); | 
		
	
		
			
				|  |  |  |  |     svc->addFunction("GetCreatureRaws", GetCreatureRaws); | 
		
	
		
			
				|  |  |  |  |     svc->addFunction("GetWorldMapCenter", GetWorldMapCenter); | 
		
	
		
			
				|  |  |  |  |     svc->addFunction("GetPlantRaws", GetPlantRaws); | 
		
	
		
			
				|  |  |  |  |     return svc; | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -1943,3 +1946,60 @@ static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     return CR_OK; | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | static command_result GetPlantRaws(color_ostream &stream, const EmptyMessage *in, PlantRawList *out) | 
		
	
		
			
				|  |  |  |  | { | 
		
	
		
			
				|  |  |  |  |     if (!df::global::world) | 
		
	
		
			
				|  |  |  |  |         return CR_FAILURE; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     df::world * world = df::global::world; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     for (int i = 0; i < world->raws.plants.all.size(); i++) | 
		
	
		
			
				|  |  |  |  |     { | 
		
	
		
			
				|  |  |  |  |         df::plant_raw* plant_local = world->raws.plants.all[i]; | 
		
	
		
			
				|  |  |  |  |         PlantRaw* plant_remote = out->add_plant_raws(); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |         plant_remote->set_index(i); | 
		
	
		
			
				|  |  |  |  |         plant_remote->set_id(plant_local->id); | 
		
	
		
			
				|  |  |  |  |         plant_remote->set_name(plant_local->name); | 
		
	
		
			
				|  |  |  |  |         if (!plant_local->flags.is_set(df::plant_raw_flags::TREE)) | 
		
	
		
			
				|  |  |  |  |             plant_remote->set_tile(plant_local->tiles.shrub_tile); | 
		
	
		
			
				|  |  |  |  |         else | 
		
	
		
			
				|  |  |  |  |             plant_remote->set_tile(plant_local->tiles.tree_tile); | 
		
	
		
			
				|  |  |  |  |         for (int j = 0; j < plant_local->growths.size(); j++) | 
		
	
		
			
				|  |  |  |  |         { | 
		
	
		
			
				|  |  |  |  |             df::plant_growth* growth_local = plant_local->growths[j]; | 
		
	
		
			
				|  |  |  |  |             TreeGrowth * growth_remote = plant_remote->add_growths(); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_index(j); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_id(growth_local->id); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_name(growth_local->name); | 
		
	
		
			
				|  |  |  |  |             for (int k = 0; k < growth_local->prints.size(); k++) | 
		
	
		
			
				|  |  |  |  |             { | 
		
	
		
			
				|  |  |  |  |                 df::plant_growth_print* print_local = growth_local->prints[k]; | 
		
	
		
			
				|  |  |  |  |                 GrowthPrint* print_remote = growth_remote->add_prints(); | 
		
	
		
			
				|  |  |  |  |                 print_remote->set_priority(print_local->priority); | 
		
	
		
			
				|  |  |  |  |                 print_remote->set_color(print_local->color[0] + (print_local->color[1] * 8)); | 
		
	
		
			
				|  |  |  |  |                 print_remote->set_timing_start(print_local->timing_start); | 
		
	
		
			
				|  |  |  |  |                 print_remote->set_timing_end(print_local->timing_end); | 
		
	
		
			
				|  |  |  |  |                 print_remote->set_tile(print_local->tile_growth); | 
		
	
		
			
				|  |  |  |  |             } | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_timing_start(growth_local->timing_1); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_timing_end(growth_local->timing_2); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_twigs(growth_local->locations.bits.twigs); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_light_branches(growth_local->locations.bits.light_branches); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_heavy_branches(growth_local->locations.bits.heavy_branches); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_trunk(growth_local->locations.bits.trunk); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_roots(growth_local->locations.bits.roots); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_cap(growth_local->locations.bits.cap); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_sapling(growth_local->locations.bits.sapling); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_timing_start(growth_local->timing_1); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_timing_end(growth_local->timing_2); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_trunk_height_start(growth_local->trunk_height_perc_1); | 
		
	
		
			
				|  |  |  |  |             growth_remote->set_trunk_height_end(growth_local->trunk_height_perc_2); | 
		
	
		
			
				|  |  |  |  |             auto growthMat = growth_remote->mutable_mat(); | 
		
	
		
			
				|  |  |  |  |             growthMat->set_mat_index(growth_local->mat_index); | 
		
	
		
			
				|  |  |  |  |             growthMat->set_mat_type(growth_local->mat_type); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     return CR_OK; | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					|  |  |  | 
 |