mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Use SoldierID
This commit is contained in:
@@ -2001,14 +2001,14 @@ UINT8 GetFittingInterjectorProfile( UINT8 usEvent, UINT8 usProfileVictim, UINT8
|
|||||||
if ( usEvent >= OPINIONEVENT_MAX )
|
if ( usEvent >= OPINIONEVENT_MAX )
|
||||||
return NO_PROFILE;
|
return NO_PROFILE;
|
||||||
|
|
||||||
INT16 idVictim = GetSoldierIDFromMercID( usProfileVictim );
|
SoldierID idVictim = GetSoldierIDFromMercID( usProfileVictim );
|
||||||
INT16 idCause = GetSoldierIDFromMercID( usProfileCause );
|
SoldierID idCause = GetSoldierIDFromMercID( usProfileCause );
|
||||||
|
|
||||||
if ( idVictim < 0 || idCause < 0 )
|
if ( idVictim == NOBODY || idCause == NOBODY )
|
||||||
return NO_PROFILE;
|
return NO_PROFILE;
|
||||||
|
|
||||||
SOLDIERTYPE* pSoldierVictim = MercPtrs[idVictim];
|
SOLDIERTYPE* pSoldierVictim = idVictim;
|
||||||
SOLDIERTYPE* pSoldierCause = MercPtrs[idCause];
|
SOLDIERTYPE* pSoldierCause = idCause;
|
||||||
|
|
||||||
if ( !pSoldierVictim || !pSoldierCause )
|
if ( !pSoldierVictim || !pSoldierCause )
|
||||||
return NO_PROFILE;
|
return NO_PROFILE;
|
||||||
|
|||||||
@@ -24251,7 +24251,7 @@ BOOLEAN SOLDIERTYPE::CanStartDrag(void)
|
|||||||
for (UINT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[CIV_TEAM].bLastID; ++cnt)
|
for (UINT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[CIV_TEAM].bLastID; ++cnt)
|
||||||
{
|
{
|
||||||
if (cnt != this->ubID &&
|
if (cnt != this->ubID &&
|
||||||
MercPtrs[cnt] &&
|
cnt != NOBODY &&
|
||||||
MercPtrs[cnt]->sGridNo == sNewGridNo &&
|
MercPtrs[cnt]->sGridNo == sNewGridNo &&
|
||||||
this->CanDragPerson(cnt))
|
this->CanDragPerson(cnt))
|
||||||
{
|
{
|
||||||
@@ -24494,31 +24494,32 @@ UINT8 GetSquadleadersCountInVicinity( SOLDIERTYPE * pSoldier, BOOLEAN fWithHighe
|
|||||||
// loop through all soldiers around
|
// loop through all soldiers around
|
||||||
for ( cnt = gTacticalStatus.Team[pSoldier->bTeam].bFirstID; cnt <= gTacticalStatus.Team[pSoldier->bTeam].bLastID; cnt++ )
|
for ( cnt = gTacticalStatus.Team[pSoldier->bTeam].bFirstID; cnt <= gTacticalStatus.Team[pSoldier->bTeam].bLastID; cnt++ )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSquadLeader = MercPtrs[cnt];
|
||||||
// Get active conscious soldier
|
// Get active conscious soldier
|
||||||
if ( MercPtrs[cnt] != pSoldier && MercPtrs[cnt]->bActive && //MercPtrs[ cnt ]->aiData.bShock < 20 &&
|
if ( pSquadLeader != pSoldier && pSquadLeader->bActive && //MercPtrs[ cnt ]->aiData.bShock < 20 &&
|
||||||
MercPtrs[cnt]->stats.bLife >= OKLIFE && HAS_SKILL_TRAIT( MercPtrs[cnt], SQUADLEADER_NT ) )
|
pSquadLeader->stats.bLife >= OKLIFE && HAS_SKILL_TRAIT( pSquadLeader, SQUADLEADER_NT ) )
|
||||||
{
|
{
|
||||||
// check if within distance
|
// check if within distance
|
||||||
// if both have extended ear, the distance is bigger and they don't need to sea each other
|
// if both have extended ear, the distance is bigger and they don't need to sea each other
|
||||||
// note that enemy always get the bonus if within distance, regardless of extended ears
|
// note that enemy always get the bonus if within distance, regardless of extended ears
|
||||||
// Flugente: moved around arguments for speed reason
|
// Flugente: moved around arguments for speed reason
|
||||||
if ( fDontCheckDistance ||
|
if ( fDontCheckDistance ||
|
||||||
(PythSpacesAway( pSoldier->sGridNo, MercPtrs[cnt]->sGridNo ) <= gSkillTraitValues.usSLRadiusNormal) ||
|
(PythSpacesAway( pSoldier->sGridNo, pSquadLeader->sGridNo ) <= gSkillTraitValues.usSLRadiusNormal) ||
|
||||||
//((SoldierToVirtualSoldierLineOfSightTest( MercPtrs[ cnt ], pSoldier->sGridNo, pSoldier->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ||
|
//((SoldierToVirtualSoldierLineOfSightTest( MercPtrs[ cnt ], pSoldier->sGridNo, pSoldier->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ||
|
||||||
//SoldierToVirtualSoldierLineOfSightTest( pSoldier, MercPtrs[ cnt ]->sGridNo, MercPtrs[ cnt ]->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ) &&
|
//SoldierToVirtualSoldierLineOfSightTest( pSoldier, MercPtrs[ cnt ]->sGridNo, MercPtrs[ cnt ]->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ) &&
|
||||||
((pSoldier->bTeam == ENEMY_TEAM || (HasExtendedEarOn( pSoldier ) && HasExtendedEarOn( MercPtrs[cnt] ))) && PythSpacesAway( pSoldier->sGridNo, MercPtrs[cnt]->sGridNo ) <= gSkillTraitValues.usSLRadiusExtendedEar)
|
((pSoldier->bTeam == ENEMY_TEAM || (HasExtendedEarOn( pSoldier ) && HasExtendedEarOn( pSquadLeader ))) && PythSpacesAway( pSoldier->sGridNo, pSquadLeader->sGridNo ) <= gSkillTraitValues.usSLRadiusExtendedEar)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// If checking for higher level SL
|
// If checking for higher level SL
|
||||||
// also count in already aquired level increses from other SLs
|
// also count in already aquired level increses from other SLs
|
||||||
if ( fWithHigherLevel )
|
if ( fWithHigherLevel )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[cnt]->stats.bExpLevel > (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius)) )
|
if ( pSquadLeader->stats.bExpLevel > (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius)) )
|
||||||
ubNumberSL += min( (max( 0, (MercPtrs[cnt]->stats.bExpLevel - (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius))) )), (NUM_SKILL_TRAITS( MercPtrs[cnt], SQUADLEADER_NT )) );
|
ubNumberSL += min( (max( 0, (pSquadLeader->stats.bExpLevel - (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius))) )), (NUM_SKILL_TRAITS( pSquadLeader, SQUADLEADER_NT )) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ubNumberSL += NUM_SKILL_TRAITS( MercPtrs[cnt], SQUADLEADER_NT );
|
ubNumberSL += NUM_SKILL_TRAITS( pSquadLeader, SQUADLEADER_NT );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ubNumberSL >= gSkillTraitValues.ubSLMaxBonuses )
|
if ( ubNumberSL >= gSkillTraitValues.ubSLMaxBonuses )
|
||||||
@@ -24532,29 +24533,30 @@ UINT8 GetSquadleadersCountInVicinity( SOLDIERTYPE * pSoldier, BOOLEAN fWithHighe
|
|||||||
{
|
{
|
||||||
for ( cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt )
|
for ( cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSquadLeader = MercPtrs[cnt];
|
||||||
// Get active conscious soldier
|
// Get active conscious soldier
|
||||||
if ( MercPtrs[cnt] != pSoldier && MercPtrs[cnt]->bActive && //MercPtrs[ cnt ]->aiData.bShock < 20 &&
|
if ( pSquadLeader != pSoldier && pSquadLeader->bActive && //MercPtrs[ cnt ]->aiData.bShock < 20 &&
|
||||||
MercPtrs[cnt]->stats.bLife >= OKLIFE && HAS_SKILL_TRAIT( MercPtrs[cnt], SQUADLEADER_NT ) )
|
pSquadLeader->stats.bLife >= OKLIFE && HAS_SKILL_TRAIT( pSquadLeader, SQUADLEADER_NT ) )
|
||||||
{
|
{
|
||||||
// check if within distance
|
// check if within distance
|
||||||
// Flugente: moved around arguments for speed reason
|
// Flugente: moved around arguments for speed reason
|
||||||
if ( fDontCheckDistance ||
|
if ( fDontCheckDistance ||
|
||||||
(PythSpacesAway( pSoldier->sGridNo, MercPtrs[cnt]->sGridNo ) <= gSkillTraitValues.usSLRadiusNormal) ||
|
(PythSpacesAway( pSoldier->sGridNo, pSquadLeader->sGridNo ) <= gSkillTraitValues.usSLRadiusNormal) ||
|
||||||
//((SoldierToVirtualSoldierLineOfSightTest( MercPtrs[ cnt ], pSoldier->sGridNo, pSoldier->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ||
|
//((SoldierToVirtualSoldierLineOfSightTest( MercPtrs[ cnt ], pSoldier->sGridNo, pSoldier->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ||
|
||||||
//SoldierToVirtualSoldierLineOfSightTest( pSoldier, MercPtrs[ cnt ]->sGridNo, MercPtrs[ cnt ]->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ) &&
|
//SoldierToVirtualSoldierLineOfSightTest( pSoldier, MercPtrs[ cnt ]->sGridNo, MercPtrs[ cnt ]->pathing.bLevel, ANIM_STAND, TRUE, CALC_FROM_ALL_DIRS ) ) &&
|
||||||
((HasExtendedEarOn( MercPtrs[cnt] ) && PythSpacesAway( pSoldier->sGridNo, MercPtrs[cnt]->sGridNo ) <= gSkillTraitValues.usSLRadiusExtendedEar))
|
((HasExtendedEarOn( pSquadLeader ) && PythSpacesAway( pSoldier->sGridNo, pSquadLeader->sGridNo ) <= gSkillTraitValues.usSLRadiusExtendedEar))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// If checking for higher level SL
|
// If checking for higher level SL
|
||||||
// also count in already aquired level increses from other SLs
|
// also count in already aquired level increses from other SLs
|
||||||
if ( fWithHigherLevel )
|
if ( fWithHigherLevel )
|
||||||
{
|
{
|
||||||
if ( MercPtrs[cnt]->stats.bExpLevel > (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius)) )
|
if ( pSquadLeader->stats.bExpLevel > (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius)) )
|
||||||
ubNumberSL += min( (max( 0, (MercPtrs[cnt]->stats.bExpLevel - (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius))) )), (NUM_SKILL_TRAITS( MercPtrs[cnt], SQUADLEADER_NT )) );
|
ubNumberSL += min( (max( 0, (pSquadLeader->stats.bExpLevel - (pSoldier->stats.bExpLevel + (ubNumberSL*gSkillTraitValues.ubSLEffectiveLevelInRadius))) )), (NUM_SKILL_TRAITS( pSquadLeader, SQUADLEADER_NT )) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ubNumberSL += NUM_SKILL_TRAITS( MercPtrs[cnt], SQUADLEADER_NT );
|
ubNumberSL += NUM_SKILL_TRAITS( pSquadLeader, SQUADLEADER_NT );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ubNumberSL >= gSkillTraitValues.ubSLMaxBonuses )
|
if ( ubNumberSL >= gSkillTraitValues.ubSLMaxBonuses )
|
||||||
|
|||||||
+11
-9
@@ -881,12 +881,14 @@ void HaltMoveForSoldierOutOfPoints(SOLDIERTYPE *pSoldier)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo)
|
void SetCivilianDestination(SoldierID ubWho, INT32 sGridNo)
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
if ( ubWho == NOBODY )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SOLDIERTYPE *pSoldier = ubWho;
|
||||||
pSoldier = MercPtrs[ubWho];
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// if we control the civilian
|
// if we control the civilian
|
||||||
@@ -896,12 +898,12 @@ void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo)
|
|||||||
// if the destination is different from what he has now
|
// if the destination is different from what he has now
|
||||||
if (pSoldier->aiData.usActionData != sGridNo)
|
if (pSoldier->aiData.usActionData != sGridNo)
|
||||||
{
|
{
|
||||||
// store his new destination
|
// store his new destination
|
||||||
pSoldier->aiData.usActionData = sGridNo;
|
pSoldier->aiData.usActionData = sGridNo;
|
||||||
|
|
||||||
// and cancel any movement in progress that he was still engaged in
|
// and cancel any movement in progress that he was still engaged in
|
||||||
pSoldier->aiData.bAction = AI_ACTION_NONE;
|
pSoldier->aiData.bAction = AI_ACTION_NONE;
|
||||||
pSoldier->aiData.bActionInProgress = FALSE;
|
pSoldier->aiData.bActionInProgress = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only set the underEscort flag once you give him a destination
|
// only set the underEscort flag once you give him a destination
|
||||||
|
|||||||
+4
-4
@@ -904,12 +904,12 @@ UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach )
|
|||||||
// SANDRO - bonus for communication with people for assertive people
|
// SANDRO - bonus for communication with people for assertive people
|
||||||
if ( gGameOptions.fNewTraitSystem && bApproach != APPROACH_THREATEN)
|
if ( gGameOptions.fNewTraitSystem && bApproach != APPROACH_THREATEN)
|
||||||
{
|
{
|
||||||
INT16 id = GetSoldierIDFromMercID( ubMerc );
|
SoldierID id = GetSoldierIDFromMercID( ubMerc );
|
||||||
if ( id > -1 )
|
if ( id != NOBODY )
|
||||||
{
|
{
|
||||||
if ( DoesMercHavePersonality( MercPtrs[id], CHAR_TRAIT_ASSERTIVE ) )
|
if ( DoesMercHavePersonality( id, CHAR_TRAIT_ASSERTIVE ) )
|
||||||
iPersonalVal += 50;
|
iPersonalVal += 50;
|
||||||
else if ( DoesMercHavePersonality( MercPtrs[id], CHAR_TRAIT_MALICIOUS ) )
|
else if ( DoesMercHavePersonality( id, CHAR_TRAIT_MALICIOUS ) )
|
||||||
iPersonalVal -= 50;
|
iPersonalVal -= 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -252,7 +252,7 @@ INT16 RandomFriendWithin(SOLDIERTYPE *pSoldier);
|
|||||||
|
|
||||||
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 *pFromGridNo);
|
INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 *pFromGridNo);
|
||||||
|
|
||||||
void SetCivilianDestination(UINT8 ubWho, INT32 sGridNo);
|
void SetCivilianDestination(SoldierID ubWho, INT32 sGridNo);
|
||||||
void SetNewSituation( SOLDIERTYPE * pSoldier );
|
void SetNewSituation( SOLDIERTYPE * pSoldier );
|
||||||
|
|
||||||
UINT8 SoldierDifficultyLevel( SOLDIERTYPE * pSoldier );
|
UINT8 SoldierDifficultyLevel( SOLDIERTYPE * pSoldier );
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner, BOOL fFromRemoteClient )
|
INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOL fFromRemoteClient )
|
||||||
{
|
{
|
||||||
SMOKEEFFECT *pSmoke;
|
SMOKEEFFECT *pSmoke;
|
||||||
INT32 iSmokeIndex;
|
INT32 iSmokeIndex;
|
||||||
@@ -222,7 +222,7 @@ INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT16 ubOwner,
|
|||||||
}
|
}
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
CHAR tmpMPDbgString[512];
|
CHAR tmpMPDbgString[512];
|
||||||
sprintf(tmpMPDbgString,"NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n",sGridNo, usItem , ubOwner , bLevel , iSmokeIndex );
|
sprintf(tmpMPDbgString,"NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n",sGridNo, usItem , ubOwner.i , bLevel , iSmokeIndex );
|
||||||
MPDebugMsg(tmpMPDbgString);
|
MPDebugMsg(tmpMPDbgString);
|
||||||
gfMPDebugOutputRandoms = true;
|
gfMPDebugOutputRandoms = true;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -327,15 +327,15 @@ void InitTacticalPlacementGUI()
|
|||||||
giPlacements = 0;
|
giPlacements = 0;
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
|
SOLDIERTYPE *pSoldier = MercPtrs[i];
|
||||||
if( MercPtrs[ i ]->bActive && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
if( pSoldier->bActive && !pSoldier->flags.fBetweenSectors &&
|
||||||
CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) &&
|
CurrentBattleSectorIs( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
|
||||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
!( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
pSoldier->bAssignment != ASSIGNMENT_POW &&
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_MINIEVENT &&
|
pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||||
!( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
!( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT )
|
pSoldier->bAssignment != IN_TRANSIT )
|
||||||
{
|
{
|
||||||
++giPlacements;
|
++giPlacements;
|
||||||
}
|
}
|
||||||
@@ -347,58 +347,59 @@ void InitTacticalPlacementGUI()
|
|||||||
giPlacements = 0;
|
giPlacements = 0;
|
||||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||||
{
|
{
|
||||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
SOLDIERTYPE *pSoldier = MercPtrs[i];
|
||||||
CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) &&
|
if( pSoldier->bActive && pSoldier->stats.bLife && !pSoldier->flags.fBetweenSectors &&
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
CurrentBattleSectorIs( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_MINIEVENT &&
|
pSoldier->bAssignment != ASSIGNMENT_POW &&
|
||||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||||
!( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT &&
|
!( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) ) // ATE Ignore vehicles
|
pSoldier->bAssignment != IN_TRANSIT &&
|
||||||
|
!( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) ) // ATE Ignore vehicles
|
||||||
{
|
{
|
||||||
// Flugente: if options allow it and we entered this sector - in combat - via helicopter, then allow us free selection of our entry point, and drop us from the helicopter
|
// Flugente: if options allow it and we entered this sector - in combat - via helicopter, then allow us free selection of our entry point, and drop us from the helicopter
|
||||||
if ( MercPtrs[ i ]->bTeam == gbPlayerNum && (gGameExternalOptions.ubSkyriderHotLZ == 1 || gGameExternalOptions.ubSkyriderHotLZ == 3) && MercPtrs[ i ]->usSoldierFlagMask & SOLDIER_AIRDROP )
|
if ( pSoldier->bTeam == gbPlayerNum && (gGameExternalOptions.ubSkyriderHotLZ == 1 || gGameExternalOptions.ubSkyriderHotLZ == 3) && pSoldier->usSoldierFlagMask & SOLDIER_AIRDROP )
|
||||||
{
|
{
|
||||||
AddMercToHeli( MercPtrs[ i ]->ubID );
|
AddMercToHeli( pSoldier->ubID );
|
||||||
DisableButton(iTPButtons[SPREAD_BUTTON]);
|
DisableButton(iTPButtons[SPREAD_BUTTON]);
|
||||||
|
|
||||||
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
||||||
MercPtrs[ i ]->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
||||||
gfCenter = TRUE;
|
gfCenter = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE )
|
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE )
|
||||||
{
|
{
|
||||||
gMercPlacement[giPlacements].ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
gMercPlacement[giPlacements].ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
||||||
MercPtrs[i]->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
||||||
gfCenter = TRUE;
|
gfCenter = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WANNE - MP: Check if the desired insertion direction is valid on the map. If not, choose another entry direction!
|
// WANNE - MP: Check if the desired insertion direction is valid on the map. If not, choose another entry direction!
|
||||||
if (is_networked)
|
if (is_networked)
|
||||||
{
|
{
|
||||||
MercPtrs[ i ]->ubStrategicInsertionCode = GetValidInsertionDirectionForMP(MercPtrs[ i ]->ubStrategicInsertionCode);
|
pSoldier->ubStrategicInsertionCode = GetValidInsertionDirectionForMP(pSoldier->ubStrategicInsertionCode);
|
||||||
}
|
}
|
||||||
// ATE: If we are in a vehicle - remove ourselves from it!
|
// ATE: If we are in a vehicle - remove ourselves from it!
|
||||||
//if ( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
//if ( pSoldier->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
||||||
//{
|
//{
|
||||||
// RemoveSoldierFromVehicle( MercPtrs[ i ], MercPtrs[ i ]->bVehicleID );
|
// RemoveSoldierFromVehicle( pSoldier, pSoldier->bVehicleID );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if( MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_PRIMARY_EDGEINDEX ||
|
if( pSoldier->ubStrategicInsertionCode == INSERTION_CODE_PRIMARY_EDGEINDEX ||
|
||||||
MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_SECONDARY_EDGEINDEX )
|
pSoldier->ubStrategicInsertionCode == INSERTION_CODE_SECONDARY_EDGEINDEX )
|
||||||
{
|
{
|
||||||
MercPtrs[ i ]->ubStrategicInsertionCode = (UINT8)MercPtrs[ i ]->usStrategicInsertionData;
|
pSoldier->ubStrategicInsertionCode = (UINT8)pSoldier->usStrategicInsertionData;
|
||||||
}
|
}
|
||||||
gMercPlacement[ giPlacements ].pSoldier = MercPtrs[ i ];
|
gMercPlacement[ giPlacements ].pSoldier = pSoldier;
|
||||||
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = MercPtrs[ i ]->ubStrategicInsertionCode;
|
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = pSoldier->ubStrategicInsertionCode;
|
||||||
gMercPlacement[ giPlacements ].fPlaced = FALSE;
|
gMercPlacement[ giPlacements ].fPlaced = FALSE;
|
||||||
|
|
||||||
// WANNE: We always want to have edgepoints
|
// WANNE: We always want to have edgepoints
|
||||||
CheckForValidMapEdge( &MercPtrs[ i ]->ubStrategicInsertionCode );
|
CheckForValidMapEdge( &pSoldier->ubStrategicInsertionCode );
|
||||||
|
|
||||||
// Flugente: campaign stats
|
// Flugente: campaign stats
|
||||||
switch( MercPtrs[ i ]->ubStrategicInsertionCode )
|
switch( pSoldier->ubStrategicInsertionCode )
|
||||||
{
|
{
|
||||||
case INSERTION_CODE_NORTH:
|
case INSERTION_CODE_NORTH:
|
||||||
gCurrentIncident.usIncidentFlags |= INCIDENT_ATTACKDIR_NORTH;
|
gCurrentIncident.usIncidentFlags |= INCIDENT_ATTACKDIR_NORTH;
|
||||||
@@ -415,7 +416,7 @@ void InitTacticalPlacementGUI()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WANNE - MP: Center
|
// WANNE - MP: Center
|
||||||
if (is_networked && MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_CENTER)
|
if (is_networked && pSoldier->ubStrategicInsertionCode == INSERTION_CODE_CENTER)
|
||||||
{
|
{
|
||||||
gfCenter = TRUE;
|
gfCenter = TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -237,9 +237,9 @@ void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT32 sGridNo, INT16 s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleFallIntoPitFromAnimation( UINT16 ubID )
|
void HandleFallIntoPitFromAnimation( SoldierID ubID )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier = MercPtrs[ ubID ];
|
SOLDIERTYPE *pSoldier = ubID;
|
||||||
EXITGRID ExitGrid;
|
EXITGRID ExitGrid;
|
||||||
INT32 sPitGridNo;
|
INT32 sPitGridNo;
|
||||||
// OK, get exit grid...
|
// OK, get exit grid...
|
||||||
|
|||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
#ifndef __PITS_H
|
#ifndef __PITS_H
|
||||||
#define __PITS_H
|
#define __PITS_H
|
||||||
|
|
||||||
|
#include "overhead types.h"
|
||||||
|
|
||||||
void Add3X3Pit( INT32 iMapIndex );
|
void Add3X3Pit( INT32 iMapIndex );
|
||||||
void Add5X5Pit( INT32 iMapIndex );
|
void Add5X5Pit( INT32 iMapIndex );
|
||||||
void Remove3X3Pit( INT32 iMapIndex );
|
void Remove3X3Pit( INT32 iMapIndex );
|
||||||
@@ -14,7 +16,7 @@ void RemoveAllPits();
|
|||||||
extern BOOLEAN gfShowPits;
|
extern BOOLEAN gfShowPits;
|
||||||
extern BOOLEAN gfLoadPitsWithoutArming;
|
extern BOOLEAN gfLoadPitsWithoutArming;
|
||||||
|
|
||||||
void HandleFallIntoPitFromAnimation( UINT16 ubID );
|
void HandleFallIntoPitFromAnimation( SoldierID ubID );
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user