Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID

This commit is contained in:
Asdow
2024-11-15 22:54:44 +02:00
parent ee429fd1f4
commit 131172e41a
6 changed files with 21 additions and 27 deletions
+2 -2
View File
@@ -3863,9 +3863,9 @@ void send_death( SOLDIERTYPE *pSoldier )
if(pAttacker)
{
// 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...
if (pAttacker->bTeam == pSoldier->bTeam && pSoldier->ubNextToPreviousAttackerID != NULL && pSoldier->ubNextToPreviousAttackerID != NOBODY)
pAttacker=MercPtrs[ pSoldier->ubNextToPreviousAttackerID ];