Skip to content

Commit

Permalink
Fix enemy formation with large invasions
Browse files Browse the repository at this point in the history
  • Loading branch information
Keriew committed Feb 7, 2024
1 parent 98ed0b8 commit d7bb8ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/figure/formation.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ static int add_figure(int formation_id, int figure_id, int deployed, int damage,
return fig;
}
}
return 0; // can happen on large invasions

// The rest of the code can happen on large invasions
// Try to balance the remaining soldiers evenly instead of stacking them all on one tile
return figure_id % MAX_FORMATION_FIGURES;
}

void formation_move_herds_away(int x, int y)
Expand Down

0 comments on commit d7bb8ce

Please sign in to comment.