mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID
This commit is contained in:
@@ -3863,9 +3863,9 @@ void send_death( SOLDIERTYPE *pSoldier )
|
|||||||
if(pAttacker)
|
if(pAttacker)
|
||||||
{
|
{
|
||||||
// if attacker was one of our own mercs, use the last hostile attacker as the killer if there is one
|
// if attacker was one of our own mercs, use the last hostile attacker as the killer if there is one
|
||||||
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubPreviousAttackerID != NULL && pSoldier->ubPreviousAttackerID != NOBODY)
|
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubPreviousAttackerID < NOBODY)
|
||||||
{
|
{
|
||||||
pAttacker=MercPtrs[ pSoldier->ubPreviousAttackerID ];
|
pAttacker = pSoldier->ubPreviousAttackerID;
|
||||||
// check if the new attacker was also a friendly...
|
// check if the new attacker was also a friendly...
|
||||||
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubNextToPreviousAttackerID != NULL && pSoldier->ubNextToPreviousAttackerID != NOBODY)
|
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubNextToPreviousAttackerID != NULL && pSoldier->ubNextToPreviousAttackerID != NOBODY)
|
||||||
pAttacker=MercPtrs[ pSoldier->ubNextToPreviousAttackerID ];
|
pAttacker=MercPtrs[ pSoldier->ubNextToPreviousAttackerID ];
|
||||||
|
|||||||
@@ -3117,8 +3117,8 @@ void HandleDialogueEnd( FACETYPE *pFace )
|
|||||||
case QUOTE_CLOSE_CALL:
|
case QUOTE_CLOSE_CALL:
|
||||||
case QUOTE_UNDER_HEAVY_FIRE:
|
case QUOTE_UNDER_HEAVY_FIRE:
|
||||||
case QUOTE_TAKEN_A_BREATING:
|
case QUOTE_TAKEN_A_BREATING:
|
||||||
if( pSoldier->ubPreviousAttackerID != NOBODY && !( MercPtrs[pSoldier->ubPreviousAttackerID]->bDeafenedCounter > 0 ) )
|
if( pSoldier->ubPreviousAttackerID != NOBODY && !( pSoldier->ubPreviousAttackerID->bDeafenedCounter > 0 ) )
|
||||||
PossiblyStartEnemyTaunt( MercPtrs[pSoldier->ubPreviousAttackerID], TAUNT_RIPOSTE, gTacticalStatus.ubLastQuoteProfileNUm );
|
PossiblyStartEnemyTaunt( pSoldier->ubPreviousAttackerID, TAUNT_RIPOSTE, gTacticalStatus.ubLastQuoteProfileNUm );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// select random enemy, who we see, who sees us and isn't deaf
|
// select random enemy, who we see, who sees us and isn't deaf
|
||||||
|
|||||||
@@ -3936,7 +3936,7 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse )
|
|||||||
}
|
}
|
||||||
else if(pSoldier->ubPreviousAttackerID != NOBODY)
|
else if(pSoldier->ubPreviousAttackerID != NOBODY)
|
||||||
{
|
{
|
||||||
pKillerSoldier = MercPtrs[pSoldier->ubPreviousAttackerID];
|
pKillerSoldier = pSoldier->ubPreviousAttackerID;
|
||||||
}
|
}
|
||||||
if(pKillerSoldier != NULL)
|
if(pKillerSoldier != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1187,8 +1187,8 @@ public:
|
|||||||
|
|
||||||
UINT32 uiAIDelay;
|
UINT32 uiAIDelay;
|
||||||
INT16 sReloadDelay;
|
INT16 sReloadDelay;
|
||||||
UINT16 ubPreviousAttackerID;
|
|
||||||
SoldierID ubAttackerID;
|
SoldierID ubAttackerID;
|
||||||
|
SoldierID ubPreviousAttackerID;
|
||||||
|
|
||||||
INT32 sInsertionGridNo;
|
INT32 sInsertionGridNo;
|
||||||
|
|
||||||
|
|||||||
@@ -261,13 +261,13 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
swprintf(pStrInfo, L"%s|Roaming |Range: %d\n", pStrInfo, RoamingRange(pSoldier, &usOrigin));
|
swprintf(pStrInfo, L"%s|Roaming |Range: %d\n", pStrInfo, RoamingRange(pSoldier, &usOrigin));
|
||||||
swprintf(pStrInfo, L"%s|Team |Aware: %d\n", pStrInfo, gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition);
|
swprintf(pStrInfo, L"%s|Team |Aware: %d\n", pStrInfo, gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition);
|
||||||
swprintf(pStrInfo, L"%s|Collapsed %d |BreathCollapsed %d\n", pStrInfo, pSoldier->bCollapsed, pSoldier->bBreathCollapsed);
|
swprintf(pStrInfo, L"%s|Collapsed %d |BreathCollapsed %d\n", pStrInfo, pSoldier->bCollapsed, pSoldier->bBreathCollapsed);
|
||||||
if (pSoldier->ubPreviousAttackerID != NOBODY && MercPtrs[pSoldier->ubPreviousAttackerID])
|
if (pSoldier->ubPreviousAttackerID < NOBODY)
|
||||||
{
|
{
|
||||||
swprintf(pStrInfo, L"%s|Under |Fire %d AttackerID %d AttackerTarget %d\n", pStrInfo, pSoldier->aiData.bUnderFire, pSoldier->ubPreviousAttackerID, MercPtrs[pSoldier->ubPreviousAttackerID]->sLastTarget);
|
swprintf(pStrInfo, L"%s|Under |Fire %d AttackerID %d AttackerTarget %d\n", pStrInfo, pSoldier->aiData.bUnderFire, pSoldier->ubPreviousAttackerID.i, pSoldier->ubPreviousAttackerID->sLastTarget);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf(pStrInfo, L"%s|Under |Fire %d AttackerID %d\n", pStrInfo, pSoldier->aiData.bUnderFire, pSoldier->ubPreviousAttackerID);
|
swprintf(pStrInfo, L"%s|Under |Fire %d AttackerID %d\n", pStrInfo, pSoldier->aiData.bUnderFire, pSoldier->ubPreviousAttackerID.i);
|
||||||
}
|
}
|
||||||
|
|
||||||
swprintf(pStrInfo, L"%s|Visible %d |Moved %d\n", pStrInfo, pSoldier->bVisible, pSoldier->aiData.bMoved);
|
swprintf(pStrInfo, L"%s|Visible %d |Moved %d\n", pStrInfo, pSoldier->bVisible, pSoldier->aiData.bMoved);
|
||||||
|
|||||||
+12
-18
@@ -3788,21 +3788,19 @@ void CheckTossSelfSmoke(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
// if we can afford the minimum AP cost to throw this tossable item
|
// if we can afford the minimum AP cost to throw this tossable item
|
||||||
if (pSoldier->bActionPoints >= ubMinAPcost)
|
if (pSoldier->bActionPoints >= ubMinAPcost)
|
||||||
{
|
{
|
||||||
INT32 sSpot = pSoldier->sGridNo;
|
INT32 sSpot = pSoldier->sGridNo;
|
||||||
INT8 bLevel = pSoldier->pathing.bLevel;
|
INT8 bLevel = pSoldier->pathing.bLevel;
|
||||||
|
|
||||||
INT32 sTargetSpot = NOWHERE;
|
INT32 sTargetSpot = NOWHERE;
|
||||||
INT8 bTargetLevel = bLevel;
|
INT8 bTargetLevel = bLevel;
|
||||||
|
|
||||||
INT32 sClosestThreat;
|
INT32 sClosestThreat;
|
||||||
UINT16 ubClosestThreatID = pSoldier->ubPreviousAttackerID;
|
SoldierID ubClosestThreatID = pSoldier->ubPreviousAttackerID;
|
||||||
|
|
||||||
// try to find good spot for smoke
|
// try to find good spot for smoke
|
||||||
if (ubClosestThreatID != NOBODY &&
|
if (ubClosestThreatID != NOBODY && !TileIsOutOfBounds(ubClosestThreatID->sGridNo))
|
||||||
MercPtrs[ubClosestThreatID] &&
|
|
||||||
!TileIsOutOfBounds(MercPtrs[ubClosestThreatID]->sGridNo))
|
|
||||||
{
|
{
|
||||||
sClosestThreat = MercPtrs[ubClosestThreatID]->sGridNo;
|
sClosestThreat = ubClosestThreatID->sGridNo;
|
||||||
|
|
||||||
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
||||||
}
|
}
|
||||||
@@ -3811,11 +3809,9 @@ void CheckTossSelfSmoke(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
{
|
{
|
||||||
ubClosestThreatID = ClosestSeenThreatID(pSoldier, uiThreatCnt, SEEN_LAST_TURN);
|
ubClosestThreatID = ClosestSeenThreatID(pSoldier, uiThreatCnt, SEEN_LAST_TURN);
|
||||||
|
|
||||||
if (ubClosestThreatID != NOBODY &&
|
if (ubClosestThreatID != NOBODY && !TileIsOutOfBounds(ubClosestThreatID->sGridNo))
|
||||||
MercPtrs[ubClosestThreatID] &&
|
|
||||||
!TileIsOutOfBounds(MercPtrs[ubClosestThreatID]->sGridNo))
|
|
||||||
{
|
{
|
||||||
sClosestThreat = MercPtrs[ubClosestThreatID]->sGridNo;
|
sClosestThreat = ubClosestThreatID->sGridNo;
|
||||||
|
|
||||||
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
||||||
}
|
}
|
||||||
@@ -3825,11 +3821,9 @@ void CheckTossSelfSmoke(SOLDIERTYPE *pSoldier, ATTACKTYPE *pBestThrow)
|
|||||||
{
|
{
|
||||||
ubClosestThreatID = ClosestKnownThreatID(pSoldier, uiThreatCnt);
|
ubClosestThreatID = ClosestKnownThreatID(pSoldier, uiThreatCnt);
|
||||||
|
|
||||||
if (ubClosestThreatID != NOBODY &&
|
if (ubClosestThreatID != NOBODY && !TileIsOutOfBounds(ubClosestThreatID->sGridNo))
|
||||||
MercPtrs[ubClosestThreatID] &&
|
|
||||||
!TileIsOutOfBounds(MercPtrs[ubClosestThreatID]->sGridNo))
|
|
||||||
{
|
{
|
||||||
sClosestThreat = MercPtrs[ubClosestThreatID]->sGridNo;
|
sClosestThreat = ubClosestThreatID->sGridNo;
|
||||||
|
|
||||||
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
sTargetSpot = FindTossSpotInDirection(sSpot, bLevel, sClosestThreat, TRUE, TRUE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user