| 694 | } |
| 695 | |
| 696 | static void add_assigned_noble_units(vector<df::unit *> &units, |
| 697 | const df::historical_entity::T_positions &positions, int32_t noble_position_id, size_t limit) |
| 698 | { |
| 699 | for (auto assignment : positions.assignments) { |
| 700 | if (assignment->position_id != noble_position_id) |
| 701 | continue; |
| 702 | auto histfig = df::historical_figure::find(assignment->histfig); |
| 703 | if (!histfig) |
| 704 | continue; |
| 705 | auto unit = df::unit::find(histfig->unit_id); |
| 706 | if (!unit) |
| 707 | continue; |
| 708 | units.emplace_back(unit); |
| 709 | if (limit > 0 && units.size() >= limit) |
| 710 | break; |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | static void add_entity_nobles(vector<df::unit *> &units, |
| 715 | string noble, size_t limit, df::historical_entity *he) |
no test coverage detected