Send over material tissues through RemoteFortressReader

develop
Japa 2016-06-30 14:33:15 +05:30
parent cfaba3ec71
commit b196ecf351
2 changed files with 26 additions and 1 deletions

@ -492,6 +492,14 @@ message BpAppearanceModifier
optional int32 mod_max = 3;
}
message TissueRaw
{
optional string id = 1;
optional string name = 2;
optional MatPair material = 3;
optional string subordinate_to_tissue = 4;
}
message CasteRaw
{
optional int32 index = 1;
@ -524,6 +532,7 @@ message CreatureRaw
optional ColorDefinition color = 8;
optional int32 adultsize = 9;
repeated CasteRaw caste = 10;
repeated TissueRaw tissues = 11;
}
message CreatureRawList

@ -62,6 +62,7 @@
#include "df/unit.h"
#include "df/creature_raw.h"
#include "df/caste_raw.h"
#include "df/tissue.h"
#include "df/enabler.h"
#include "df/graphic.h"
@ -2409,7 +2410,22 @@ static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage
send_caste->set_description(orig_caste->description);
send_caste->set_adult_size(orig_caste->misc.adult_size);
}
}
for (int j = 0; j < orig_creature->tissue.size(); j++)
{
auto orig_tissue = orig_creature->tissue[j];
auto send_tissue = send_creature->add_tissues();
send_tissue->set_id(orig_tissue->id);
send_tissue->set_name(orig_tissue->tissue_name_singular);
send_tissue->set_subordinate_to_tissue(orig_tissue->subordinate_to_tissue);
auto send_mat = send_tissue->mutable_material();
send_mat->set_mat_index(orig_tissue->mat_index);
send_mat->set_mat_type(orig_tissue->mat_type);
}
}
return CR_OK;
}