mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
FindSoldierByProfileID fix: check last soldier in player team
RenderOverheadOverlays fix: last soldier in player team StartInterrupt fix: all interrupts in original interrupt system start as hidden and revealed later if soldier decides something StartInterrupt fix: don't show hidden interrupt DeductPoints, ResolvePendingInterrupt, StartInterrupt: MAX_NUM_SOLDIERS fix SoldierCollapse: replace chosen one if soldier is collapsed git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8259 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+4
-3
@@ -1024,7 +1024,7 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub
|
||||
SOLDIERTYPE *pOpponent;
|
||||
BOOLEAN fFoundInterrupter = FALSE;
|
||||
|
||||
for ( uCnt = 0; uCnt <= MAX_NUM_SOLDIERS; uCnt++ )
|
||||
for ( uCnt = 0; uCnt < MAX_NUM_SOLDIERS; uCnt++ )
|
||||
{
|
||||
// first find all guys who watch us
|
||||
pOpponent = MercPtrs[ uCnt ];
|
||||
@@ -4020,11 +4020,12 @@ INT16 GetAPsToJumpOver( SOLDIERTYPE *pSoldier )
|
||||
// APBP Constants and extra game features.
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime )
|
||||
{
|
||||
Assert(pSoldier != NULL);
|
||||
Assert(&pSoldier->inv[HANDPOS] != NULL);
|
||||
|
||||
INT16 sAPCost = 0;
|
||||
UINT16 usItemNum = pSoldier->inv[HANDPOS].usItem;
|
||||
|
||||
Assert(pSoldier != NULL);
|
||||
Assert(&pSoldier->inv[HANDPOS] != NULL);
|
||||
#ifndef dnlCALCBESTSHOT//dnl ch69 150913 if this is turn on we get incorrect APs as MinAPsToShootOrStab always include raise gun cost
|
||||
if (!ARMED_VEHICLE(pSoldier) && !( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_FIREREADY | ANIM_FIRE )))//dnl ch64 310813
|
||||
{
|
||||
|
||||
@@ -19384,8 +19384,9 @@ void SoldierCollapse( SOLDIERTYPE *pSoldier )
|
||||
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_ENEMY )
|
||||
{
|
||||
|
||||
if ( !(gTacticalStatus.bPanicTriggerIsAlarm) && (gTacticalStatus.ubTheChosenOne == pSoldier->ubID) )
|
||||
// sevenfm: bPanicTriggerIsAlarm is always not NULL pointer
|
||||
//if ( !(gTacticalStatus.bPanicTriggerIsAlarm) && (gTacticalStatus.ubTheChosenOne == pSoldier->ubID) )
|
||||
if ( gTacticalStatus.ubTheChosenOne == pSoldier->ubID )
|
||||
{
|
||||
// replace this guy as the chosen one!
|
||||
gTacticalStatus.ubTheChosenOne = NOBODY;
|
||||
@@ -21909,7 +21910,7 @@ BOOLEAN ResolvePendingInterrupt( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType )
|
||||
UINT16 uCnt = 0, uiReactionTime;
|
||||
INT16 iInjuryPenalty;
|
||||
|
||||
for ( uCnt = 0; uCnt <= MAX_NUM_SOLDIERS; uCnt++ )
|
||||
for ( uCnt = 0; uCnt < MAX_NUM_SOLDIERS; uCnt++ )
|
||||
{
|
||||
// first find all guys who can see us
|
||||
pInterrupter = MercPtrs[uCnt];
|
||||
|
||||
@@ -491,8 +491,10 @@ void RandomStats()
|
||||
pProfile->bExpLevel = RandomAbsoluteRange( pProfile->bExpLevel, 1, 10, Exp, Type );
|
||||
|
||||
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
|
||||
{
|
||||
pProfile->bLifeMax = RandomAbsoluteRange( pProfile->bLifeMax, 1, 100, Stats, Type );
|
||||
pProfile->bLife = pProfile->bLifeMax;
|
||||
}
|
||||
|
||||
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
|
||||
pProfile->bAgility = RandomAbsoluteRange( pProfile->bAgility, 1, 100, Stats, Type );
|
||||
@@ -1647,17 +1649,20 @@ SOLDIERTYPE * FindSoldierByProfileID( UINT8 ubProfileID, BOOLEAN fPlayerMercsOnl
|
||||
UINT8 ubLoop, ubLoopLimit;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
|
||||
// sevenfm: fix for last soldier in player team
|
||||
if (fPlayerMercsOnly)
|
||||
{
|
||||
ubLoopLimit = gTacticalStatus.Team[0].bLastID;
|
||||
ubLoopLimit = gTacticalStatus.Team[0].bLastID + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubLoopLimit = MAX_NUM_SOLDIERS;
|
||||
}
|
||||
|
||||
for (ubLoop = 0, pSoldier = MercPtrs[0]; ubLoop < ubLoopLimit; ubLoop++, pSoldier++)
|
||||
for (ubLoop = 0; ubLoop < ubLoopLimit; ubLoop++)
|
||||
{
|
||||
pSoldier = MercPtrs[ubLoop];
|
||||
|
||||
if (pSoldier->bActive && pSoldier->ubProfile == ubProfileID)
|
||||
{
|
||||
return( pSoldier );
|
||||
@@ -2395,7 +2400,7 @@ SOLDIERTYPE * SwapLarrysProfiles( SOLDIERTYPE * pSoldier )
|
||||
pNewProfile->records.usExpDetonated = gMercProfiles[ ubSrcProfile ].records.usExpDetonated;
|
||||
pNewProfile->records.usItemsRepaired = gMercProfiles[ ubSrcProfile ].records.usItemsRepaired;
|
||||
pNewProfile->records.usItemsCombined = gMercProfiles[ ubSrcProfile ].records.usItemsCombined;
|
||||
pNewProfile->records.usItemsCombined = gMercProfiles[ ubSrcProfile ].records.usItemsStolen;
|
||||
pNewProfile->records.usItemsStolen = gMercProfiles[ ubSrcProfile ].records.usItemsStolen;
|
||||
pNewProfile->records.usMercsBandaged = gMercProfiles[ ubSrcProfile ].records.usMercsBandaged;
|
||||
pNewProfile->records.usSurgeriesMade = gMercProfiles[ ubSrcProfile ].records.usSurgeriesMade;
|
||||
pNewProfile->records.usNPCsDiscovered = gMercProfiles[ ubSrcProfile ].records.usNPCsDiscovered;
|
||||
|
||||
+21
-11
@@ -836,7 +836,7 @@ void StartInterrupt( void )
|
||||
gTacticalStatus.fInterruptOccurred = TRUE;
|
||||
|
||||
cnt = 0;
|
||||
for ( pTempSoldier = MercPtrs[ cnt ]; cnt <= MAX_NUM_SOLDIERS; cnt++,pTempSoldier++)
|
||||
for ( pTempSoldier = MercPtrs[ cnt ]; cnt < MAX_NUM_SOLDIERS; cnt++,pTempSoldier++)
|
||||
{
|
||||
if ( pTempSoldier->bActive )
|
||||
{
|
||||
@@ -858,7 +858,7 @@ void StartInterrupt( void )
|
||||
|
||||
// build string for display of who gets interrupt
|
||||
//while( 1 )
|
||||
for( iCounter = 0; iCounter <= MAX_NUM_SOLDIERS; iCounter++ )
|
||||
for( iCounter = 0; iCounter < MAX_NUM_SOLDIERS; iCounter++ )
|
||||
{
|
||||
MercPtrs[ubInterrupter]->aiData.bMoved = FALSE;
|
||||
DebugMsg( TOPIC_JA2INTERRUPT, DBG_LEVEL_3, String("INTERRUPT: popping %d off of the interrupt queue", ubInterrupter ) );
|
||||
@@ -1017,7 +1017,7 @@ void StartInterrupt( void )
|
||||
|
||||
//while( 1 )
|
||||
UINT16 usCounter;
|
||||
for( usCounter = 0; usCounter <= MAX_NUM_SOLDIERS; usCounter++ )
|
||||
for( usCounter = 0; usCounter < MAX_NUM_SOLDIERS; usCounter++ )
|
||||
{
|
||||
MercPtrs[ubInterrupter]->aiData.bMoved = FALSE;
|
||||
|
||||
@@ -1049,12 +1049,17 @@ void StartInterrupt( void )
|
||||
pTempSoldier = MercPtrs[ cnt ];
|
||||
// pSoldier = MercPtrs[ubFirstInterrupter];
|
||||
|
||||
// sevenfm: check that soldier is not NULL
|
||||
Assert(pTempSoldier);
|
||||
|
||||
//if ( gTacticalStatus.ubCurrentTeam == OUR_TEAM )//hayden
|
||||
// if ( pSoldier->bTeam > OUR_TEAM && pSoldier->bTeam < 6) // cheap disable
|
||||
// SANDRO - we don't use the "hidden interrupt" feature with IIS
|
||||
if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameOptions.fImprovedInterruptSystem
|
||||
// sevenfm: all interrupts in original interrupt system start as hidden and revealed later if soldier decides something
|
||||
/*if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameOptions.fImprovedInterruptSystem
|
||||
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_CURRENTLY
|
||||
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_THIS_TURN )
|
||||
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_THIS_TURN )*/
|
||||
if ( !is_networked && pSoldier->bTeam != OUR_TEAM && !gGameOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
// we're being interrupted by the computer!
|
||||
// we delay displaying any interrupt message until the computer
|
||||
@@ -1073,11 +1078,16 @@ void StartInterrupt( void )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Interrupt ( could be hidden )" );
|
||||
#endif
|
||||
}
|
||||
// SANDRO - show correct top message
|
||||
if (pTempSoldier->bTeam == MILITIA_TEAM )
|
||||
AddTopMessage( MILITIA_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
|
||||
else
|
||||
AddTopMessage( COMPUTER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
|
||||
|
||||
// sevenfm: don't show hidden interrupt
|
||||
if( !gfHiddenInterrupt )
|
||||
{
|
||||
// SANDRO - show correct top message
|
||||
if (pTempSoldier->bTeam == MILITIA_TEAM )
|
||||
AddTopMessage( MILITIA_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
|
||||
else
|
||||
AddTopMessage( COMPUTER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
|
||||
}
|
||||
|
||||
if (pTempSoldier != NULL)
|
||||
{
|
||||
@@ -1221,7 +1231,7 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
|
||||
pSoldier = MercPtrs[ubInterruptedSoldier];
|
||||
|
||||
cnt = 0;
|
||||
for ( pTempSoldier = MercPtrs[ cnt ]; cnt <= MAX_NUM_SOLDIERS; cnt++,pTempSoldier++)
|
||||
for ( pTempSoldier = MercPtrs[ cnt ]; cnt < MAX_NUM_SOLDIERS; cnt++,pTempSoldier++)
|
||||
{
|
||||
if ( pTempSoldier->bActive )
|
||||
{
|
||||
|
||||
@@ -1165,7 +1165,6 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
pTile = &( gSmTileDB[ pNode->usIndex ] );
|
||||
|
||||
sX = sTempPosX_S;
|
||||
sY = sTempPosY_S - sHeight;
|
||||
//dnl ch82 081213
|
||||
sY = sTempPosY_S;
|
||||
if(gTileDatabase[pNode->usIndex].uiFlags & IGNORE_WORLD_HEIGHT)
|
||||
@@ -1395,7 +1394,7 @@ void RenderOverheadOverlays()
|
||||
//SOLDIER OVERLAY
|
||||
if( gfTacticalPlacementGUIActive )
|
||||
{ //loop through only the player soldiers
|
||||
end = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||
end = gTacticalStatus.Team[ OUR_TEAM ].bLastID + 1;
|
||||
}
|
||||
else
|
||||
{ //loop through all soldiers.
|
||||
|
||||
Reference in New Issue
Block a user