Send noble positions and professions along with Units.

develop
Japa Illo 2017-02-03 10:08:35 +05:30
parent d97b0497b3
commit c8e6845a7f
1 changed files with 14 additions and 0 deletions

@ -96,6 +96,7 @@
#include "df/world_region_details.h" #include "df/world_region_details.h"
#include "df/world_site.h" #include "df/world_site.h"
#include "df/world_site_realization.h" #include "df/world_site_realization.h"
#include "df/entity_position.h"
#if DF_VERSION > 40001 #if DF_VERSION > 40001
#include "df/plant_growth.h" #include "df/plant_growth.h"
@ -1800,6 +1801,19 @@ static command_result GetUnitList(color_ostream &stream, const EmptyMessage *in,
for (int j = 0; j < unit->appearance.colors.size(); j++) for (int j = 0; j < unit->appearance.colors.size(); j++)
appearance->add_colors(unit->appearance.colors[j]); appearance->add_colors(unit->appearance.colors[j]);
appearance->set_size_modifier(unit->appearance.size_modifier); appearance->set_size_modifier(unit->appearance.size_modifier);
send_unit->set_profession_id(unit->profession);
std::vector<Units::NoblePosition> pvec;
if (Units::getNoblePositions(&pvec, unit))
{
for (int j = 0; j < pvec.size(); j++)
{
auto noble_positon = pvec[j];
send_unit->add_noble_positions(noble_positon.position->code);
}
}
} }
return CR_OK; return CR_OK;
} }