Thalassicus
Bytes and Nibblers
I figured this out by narrowing it down to the two tables below.
This works:
This does not:
Both of these give the Invisible promotion correctly. However, if other promotions require Invisible, #1 works but not #2. The only explanation I can think of is a bug in the promotion-earning code. It seems like this is what happens:
This is unecessary design because if a unit has the prerequisite promotion, there's no need to check if it can have that promotion!
The design also makes it easy to introduce bugs like forgetting to check Policy_FreePromotions. The better solution is to only do step 1; the other steps waste processing power and resulted in buggy code.
This works:
Code:
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_WARRIOR</UnitType>
<PromotionType>PROMOTION_INVISIBLE_SUBMARINE</PromotionType>
</Row>
</Unit_FreePromotions>
Code:
<Policy_FreePromotions>
<Row>
<PolicyType>POLICY_HONOR</PolicyType>
<PromotionType>PROMOTION_INVISIBLE_SUBMARINE</PromotionType>
</Row>
</Policy_FreePromotions>
- Check if the unit has the prerequisite promotion.
- Check if the prereq has CannotBeChosen=false and is in one of these tables:
- UnitPromotions_UnitCombats
- Unit_FreePromotions
- Recursively start at step 1 for the prereq's prereq.
This is unecessary design because if a unit has the prerequisite promotion, there's no need to check if it can have that promotion!
