Skip to content

Commit

Permalink
Fix military sidebar for the infantry
Browse files Browse the repository at this point in the history
  • Loading branch information
Keriew committed Jan 30, 2024
1 parent aec354f commit 65c27db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/widget/sidebar/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static struct {
static int available_layouts_for_legion(const formation *m)
{
int layouts = LAYOUTS_PER_LEGION;
if (m->figure_type == FIGURE_FORT_LEGIONARY) {
if (m->figure_type == FIGURE_FORT_LEGIONARY || m->figure_type == FIGURE_FORT_INFANTRY) {
if (m->has_military_training) {
layouts = LAYOUTS_PER_LEGION - 1;
} else {
Expand All @@ -170,7 +170,7 @@ static void draw_layout_buttons(int x, int y, int background, const formation *m
if (city_view_orientation() == DIR_6_LEFT || city_view_orientation() == DIR_2_RIGHT) {
index = 1;
}
const int *offsets = (m->figure_type == FIGURE_FORT_LEGIONARY) ?
const int *offsets = (m->figure_type == FIGURE_FORT_LEGIONARY || m->figure_type == FIGURE_FORT_INFANTRY) ?
LAYOUT_IMAGE_OFFSETS_LEGIONARY[index] : LAYOUT_IMAGE_OFFSETS_AUXILIARY[index];
int formation_types = available_layouts_for_legion(m);

Expand Down Expand Up @@ -463,7 +463,7 @@ int widget_sidebar_military_get_tooltip_text(tooltip_context *c)
int index = data.inner_buttons_focus_id - 1;
int layout;
const formation *m = formation_get(data.active_legion.formation_id);
if (m->figure_type == FIGURE_FORT_LEGIONARY) {
if (m->figure_type == FIGURE_FORT_LEGIONARY || m->figure_type == FIGURE_FORT_INFANTRY) {
int index_increase = m->has_military_training ? 1 : 2;
if (index > 4 - index_increase) {
return 0;
Expand Down Expand Up @@ -583,7 +583,7 @@ static void button_select_formation_layout(int index, int param2)
}
const int *layout_indexes;
int swap_lines = city_view_orientation() == DIR_6_LEFT || city_view_orientation() == DIR_2_RIGHT;
if (m->figure_type == FIGURE_FORT_LEGIONARY) {
if (m->figure_type == FIGURE_FORT_LEGIONARY || m->figure_type == FIGURE_FORT_INFANTRY) {
int index_increase = m->has_military_training ? 1 : 2;
if (index > 4 - index_increase) {
return;
Expand Down

0 comments on commit 65c27db

Please sign in to comment.