Fixes (by Sevenfm):

- wrong level calculation for suppression resistance with friends
- incorrect buddy handling
- incorrect PoW, medic, wounded determination

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8643 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2018-12-02 14:59:08 +00:00
parent 389f40ba3d
commit 8b58f9a1bf
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -55,8 +55,8 @@
#endif #endif
CHAR8 czVersionNumber[16] = { "Build 18.10.11" }; //YY.MM.DD CHAR8 czVersionNumber[16] = { "Build 18.12.02" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" }; CHAR16 zTrackingNumber[16] = { L"Z" };
CHAR16 zRevisionNumber[16] = { L"Revision 8640" }; CHAR16 zRevisionNumber[16] = { L"Revision 8643" };
// SAVE_GAME_VERSION is defined in header, change it there // SAVE_GAME_VERSION is defined in header, change it there
+6 -6
View File
@@ -10274,7 +10274,7 @@ INT8 CheckStatusNearbyFriendlies( SOLDIERTYPE *pSoldier )
UINT16 usEffectiveRangeToLeader = 0; UINT16 usEffectiveRangeToLeader = 0;
INT16 usBestLeader = 0; INT16 usBestLeader = 0;
INT16 usFriendBonus = 0; INT16 usFriendBonus = 0;
UINT8 ubLevelDifference = 0; INT8 bLevelDifference = 0;
// Run through each friendly. // Run through each friendly.
for ( UINT8 iCounter = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID ; iCounter <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID ; iCounter ++ ) for ( UINT8 iCounter = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID ; iCounter <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID ; iCounter ++ )
@@ -10285,25 +10285,25 @@ INT8 CheckStatusNearbyFriendlies( SOLDIERTYPE *pSoldier )
if (pLeader != pSoldier && pLeader->bActive && pLeader->aiData.bShock < pLeader->stats.bLeadership/5 && if (pLeader != pSoldier && pLeader->bActive && pLeader->aiData.bShock < pLeader->stats.bLeadership/5 &&
pLeader->stats.bLife >= OKLIFE ) pLeader->stats.bLife >= OKLIFE )
{ {
ubLevelDifference = (pLeader->stats.bExpLevel - pSoldier->stats.bExpLevel ); bLevelDifference = pLeader->stats.bExpLevel - pSoldier->stats.bExpLevel;
// Calculate character's leadership and range/3 // Calculate character's leadership and range/3
usEffectiveLeadership = ((EffectiveLeadership( pLeader ) - 25) / 15); usEffectiveLeadership = (EffectiveLeadership( pLeader ) - 25) / 15;
usEffectiveRangeToLeader = PythSpacesAway( pSoldier->sGridNo, pLeader->sGridNo ) / 3; usEffectiveRangeToLeader = PythSpacesAway( pSoldier->sGridNo, pLeader->sGridNo ) / 3;
// SANDRO - add effective leadership and level to determine if we can help our friend to feel better :) // SANDRO - add effective leadership and level to determine if we can help our friend to feel better :)
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pLeader, SQUADLEADER_NT ) ) if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pLeader, SQUADLEADER_NT ) )
{ {
ubLevelDifference += (gSkillTraitValues.ubSLEffectiveLevelAsStandby * NUM_SKILL_TRAITS( pLeader, SQUADLEADER_NT )); bLevelDifference += (gSkillTraitValues.ubSLEffectiveLevelAsStandby * NUM_SKILL_TRAITS( pLeader, SQUADLEADER_NT ));
usEffectiveLeadership += (gSkillTraitValues.ubSLEffectiveLevelAsStandby * NUM_SKILL_TRAITS( pLeader, SQUADLEADER_NT )); usEffectiveLeadership += (gSkillTraitValues.ubSLEffectiveLevelAsStandby * NUM_SKILL_TRAITS( pLeader, SQUADLEADER_NT ));
} }
if ( ubLevelDifference >= 0 ) if ( bLevelDifference >= 0 )
{ {
// If leader is within range of his leadership stat // If leader is within range of his leadership stat
if (usEffectiveRangeToLeader <= usEffectiveLeadership+1) if (usEffectiveRangeToLeader <= usEffectiveLeadership+1)
{ {
// The difference in experience level is important! // The difference in experience level is important!
usEffectiveLeadership += ubLevelDifference; usEffectiveLeadership += bLevelDifference;
// Reduce effective leadership with every 3 tiles of distance // Reduce effective leadership with every 3 tiles of distance
usEffectiveLeadership -= usEffectiveRangeToLeader-1; usEffectiveLeadership -= usEffectiveRangeToLeader-1;
+1 -1
View File
@@ -2151,7 +2151,7 @@ BOOLEAN DoesMercHaveABuddyOnTheTeam( UINT8 ubMercID )
} }
//If its not a valid 'buddy' //If its not a valid 'buddy'
if( bBuddyID < 0 ) if( bBuddyID == NUM_PROFILES )
continue; continue;
if( IsMercOnTeam( bBuddyID, FALSE, FALSE ) ) if( IsMercOnTeam( bBuddyID, FALSE, FALSE ) )
+3 -3
View File
@@ -3166,7 +3166,7 @@ UINT8 GetClosestFlaggedSoldierID( SOLDIERTYPE * pSoldier, INT16 aRange, UINT8 au
// this is not for tanks // this is not for tanks
if ( ARMED_VEHICLE( pFriend ) ) if ( ARMED_VEHICLE( pFriend ) )
return FALSE; continue;
// skip if this guy is dead // skip if this guy is dead
if ( pFriend->stats.bLife <= 0 ) if ( pFriend->stats.bLife <= 0 )
@@ -3219,7 +3219,7 @@ UINT8 GetClosestWoundedSoldierID( SOLDIERTYPE * pSoldier, INT16 aRange, UINT8 au
// this is not for tanks // this is not for tanks
if ( ARMED_VEHICLE( pFriend ) ) if ( ARMED_VEHICLE( pFriend ) )
return FALSE; continue;
// skip if this guy is dead, or not wounded (enough) // skip if this guy is dead, or not wounded (enough)
if ( pFriend->stats.bLife <= 0 || pFriend->iHealableInjury < gGameExternalOptions.sEnemyMedicsWoundMinAmount ) if ( pFriend->stats.bLife <= 0 || pFriend->iHealableInjury < gGameExternalOptions.sEnemyMedicsWoundMinAmount )
@@ -3268,7 +3268,7 @@ UINT8 GetClosestMedicSoldierID( SOLDIERTYPE * pSoldier, INT16 aRange, UINT8 auTe
// this is not for tanks // this is not for tanks
if ( ARMED_VEHICLE( pFriend ) ) if ( ARMED_VEHICLE( pFriend ) )
return FALSE; continue;
// skip this guy if he is dead or unconscious // skip this guy if he is dead or unconscious
if ( pFriend->stats.bLife < OKLIFE ) if ( pFriend->stats.bLife < OKLIFE )