Julius: Wrong roman influence army calculation?

Created on 13 Mar 2020  路  1Comment  路  Source: bvschaik/julius

In function enemy_army_calculate_roman_influence:

https://github.com/bvschaik/julius/blob/7d8e06f426b7eaa2dc365d77355299cec6ab1f39/src/figure/enemy_army.c#L97-L101

Shouldn't the code be MAX_FORMATIONS instead of MAX_LEGIONS on line 97? Or is this an original bug?

Note that the same bug is present when using the L hotkey to cycle the legions.

bug

Most helpful comment

So this is and isn't a bug. The game always assigns our legions to the first six slots of available formations. So there's really no difference between using MAX_LEGIONS or MAX_FORMATIONS, as the last formation index will always be inside the MAX_LEGIONS.

This could however be a problem if more legions are added, specifically more than 9 legions (as it seems the herds get assigned to formation 10). That shouldn't happen in Julius but might be a problem for Augustus, so for code consistency I'd say we should fix this.

>All comments

So this is and isn't a bug. The game always assigns our legions to the first six slots of available formations. So there's really no difference between using MAX_LEGIONS or MAX_FORMATIONS, as the last formation index will always be inside the MAX_LEGIONS.

This could however be a problem if more legions are added, specifically more than 9 legions (as it seems the herds get assigned to formation 10). That shouldn't happen in Julius but might be a problem for Augustus, so for code consistency I'd say we should fix this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathanmcnamee picture jonathanmcnamee  路  3Comments

devnoname120 picture devnoname120  路  5Comments

jfkonecn picture jfkonecn  路  5Comments

Uberwire picture Uberwire  路  5Comments

giggietto picture giggietto  路  8Comments