Fixes (by Buggler)

- Fixed allow exception to Dr Q. skill trait code not fully functional
- Swapped Dr Q. skill trait xml order so that when exception disabled, he will still have his night ops minor skill due to code execution order
- Externalized allow_exception ID number for modding

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5791 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-01-15 20:04:41 +00:00
parent c49f59f66e
commit 56e08dbeae
4 changed files with 30 additions and 17 deletions
+14 -12
View File
@@ -17838,16 +17838,17 @@ BOOLEAN HAS_SKILL_TRAIT( SOLDIERTYPE * pSoldier, UINT8 uiSkillTraitNumber )
INT8 bNumMajorTraitsCounted = 0;
INT8 bMaxTraits = gSkillTraitValues.ubMaxNumberOfTraits;
INT8 bMaxMajorTraits = gSkillTraitValues.ubNumberOfMajorTraitsAllowed;
// special case for Dr.Q - he's allowed to have 3 major traits and one minor for total by default
if ( pSoldier->ubProfile == 33 && gSkillTraitValues.fAllowDrQTraitsException )
{
bMaxTraits++;
bMaxMajorTraits++;
}
// check old/new traits
if (gGameOptions.fNewTraitSystem)
{
// exception for special merc
if ( gSkillTraitValues.fAllowSpecialMercTraitsException && pSoldier->ubProfile == gSkillTraitValues.ubSpecialMercID)
{
bMaxTraits++;
bMaxMajorTraits++;
}
for ( INT8 bCnt = 0; bCnt < min(30,bMaxTraits); bCnt++ )
{
if ( TwoStagedTrait( uiSkillTraitNumber ) )
@@ -17894,16 +17895,17 @@ INT8 NUM_SKILL_TRAITS( SOLDIERTYPE * pSoldier, UINT8 uiSkillTraitNumber )
INT8 bNumMajorTraitsCounted = 0;
INT8 bMaxTraits = gSkillTraitValues.ubMaxNumberOfTraits;
INT8 bMaxMajorTraits = gSkillTraitValues.ubNumberOfMajorTraitsAllowed;
// special case for Dr.Q - he's allowed to have 3 major traits and one minor for total by default
if ( pSoldier->ubProfile == 33 && gSkillTraitValues.fAllowDrQTraitsException )
{
bMaxTraits++;
bMaxMajorTraits++;
}
// check old/new traits
if (gGameOptions.fNewTraitSystem)
{
// exception for special merc
if ( gSkillTraitValues.fAllowSpecialMercTraitsException && pSoldier->ubProfile == gSkillTraitValues.ubSpecialMercID)
{
bMaxTraits++;
bMaxMajorTraits++;
}
for ( INT8 bCnt = 0; bCnt < min(30,bMaxTraits); bCnt++ )
{
if ( TwoStagedTrait( uiSkillTraitNumber ) )