@Levis : while working with the leveling perk stuff I stumbled on a small bug to correct.
Currently, a hired officer has a 90% chance of having 2 bonus skills, and a 10% chance of having none. There is no chance of having 1 bonus skill. I thought this was by design until now.
The reason is these two lines are reversed in Leveling.c:
if(val < NPC_ONE_BONUS_CHANCE) numbonus = 1;
if(val < (NPC_ONE_BONUS_CHANCE+NPC_TWO_BONUS_CHANCE)) numbonus = 2;
If the condition for 1 is satisfied, the condition for 2 is satisfied also, which is the source of the bug, 90% chance for two bonuses this way.
Those two need to be flipped around and two substituted for one like this:
if(val < (NPC_ONE_BONUS_CHANCE+NPC_TWO_BONUS_CHANCE)) numbonus = 1;
if(val < NPC_TWO_BONUS_CHANCE) numbonus = 2;
Then there will be:
10% no bonuses
60% only one bonus
30% two bonuses
Which is the goal I think.
File attached if so.
Currently, a hired officer has a 90% chance of having 2 bonus skills, and a 10% chance of having none. There is no chance of having 1 bonus skill. I thought this was by design until now.
The reason is these two lines are reversed in Leveling.c:
if(val < NPC_ONE_BONUS_CHANCE) numbonus = 1;
if(val < (NPC_ONE_BONUS_CHANCE+NPC_TWO_BONUS_CHANCE)) numbonus = 2;
If the condition for 1 is satisfied, the condition for 2 is satisfied also, which is the source of the bug, 90% chance for two bonuses this way.
Those two need to be flipped around and two substituted for one like this:
if(val < (NPC_ONE_BONUS_CHANCE+NPC_TWO_BONUS_CHANCE)) numbonus = 1;
if(val < NPC_TWO_BONUS_CHANCE) numbonus = 2;
Then there will be:
10% no bonuses
60% only one bonus
30% two bonuses
Which is the goal I think.
