mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- removed compile warnings
- Fix: sometimes, capturing the last enemy did not end combat as it should - code change: POW are no longer considered visible opponents. This avoids the error of incorrect sight counters (a bit similar to dying enemies) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5752 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6765,10 +6765,11 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
// Kill those not already dead.,...
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector && pTeamSoldier->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
// For sure for flag thet they are dead is not set
|
||||
// Only pows that are not dead yet
|
||||
if ( ( pTeamSoldier->bSoldierFlagMask & SOLDIER_POW ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_DEAD ) )
|
||||
{
|
||||
if ( pTeamSoldier->stats.bLife > OKLIFE && pTeamSoldier->stats.bLife != 0 )
|
||||
// if we arrive here and the guy has lifepoints < OKLIFE, something is very odd... better take him prisoner and remove him anyway
|
||||
//if ( pTeamSoldier->stats.bLife > OKLIFE && pTeamSoldier->stats.bLife != 0 )
|
||||
{
|
||||
switch ( pTeamSoldier->ubSoldierClass )
|
||||
{
|
||||
@@ -10109,6 +10110,9 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
|
||||
if( pSoldier->stats.bLife >= OKLIFE )
|
||||
{
|
||||
pSoldier->bSoldierFlagMask |= SOLDIER_POW;
|
||||
|
||||
// Remove as target
|
||||
RemoveManAsTarget( pSoldier );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16326,6 +16326,9 @@ void SOLDIERTYPE::EVENT_SoldierHandcuffPerson( INT32 sGridNo, UINT8 ubDirection
|
||||
// arrest this guy
|
||||
pSoldier->bSoldierFlagMask |= SOLDIER_POW;
|
||||
|
||||
// Remove as target
|
||||
RemoveManAsTarget( pSoldier );
|
||||
|
||||
// move the items in his hands to the floor and move our handcuff into his hands
|
||||
if ( pSoldier->inv[ HANDPOS ].exists() == true && !( pSoldier->inv[ HANDPOS ].fFlags & OBJECT_UNDROPPABLE ))
|
||||
{
|
||||
@@ -16381,6 +16384,9 @@ void SOLDIERTYPE::EVENT_SoldierHandcuffPerson( INT32 sGridNo, UINT8 ubDirection
|
||||
StatChange( this, EXPERAMT, 2, TRUE );
|
||||
|
||||
DeductPoints( this, GetAPsToHandcuff( this, sGridNo ), 0, AFTERACTION_INTERRUPT );
|
||||
|
||||
// this might have been the last guy...
|
||||
CheckForEndOfBattle( FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -414,9 +414,6 @@ extern CLOTHES_STRUCT Clothes[CLOTHES_MAX];
|
||||
// but they can't attack empty vehicles!!
|
||||
#define CONSIDERED_NEUTRAL( me, them ) ( (them->aiData.bNeutral || them->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER|SOLDIER_POW)) && ( me->bTeam != CREATURE_TEAM || (them->flags.uiStatusFlags & SOLDIER_VEHICLE) ) )
|
||||
|
||||
// Flugente: this version still counts POWs as enemies. This allows correct refreshing of the enemy count whn taking prisoners and then moving away
|
||||
#define CONSIDERED_NEUTRAL_NOT_POW( me, them ) ( (them->aiData.bNeutral || them->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER)) && ( me->bTeam != CREATURE_TEAM || (them->flags.uiStatusFlags & SOLDIER_VEHICLE) ) )
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubKeyID;
|
||||
|
||||
@@ -1773,7 +1773,7 @@ void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT
|
||||
{
|
||||
// if neither side is neutral AND
|
||||
// if this soldier is an opponent (fights for different side)
|
||||
if (pSoldier->bActive && pOpponent->bActive && !CONSIDERED_NEUTRAL_NOT_POW( pOpponent, pSoldier ) && !CONSIDERED_NEUTRAL_NOT_POW( pSoldier, pOpponent ) && (pSoldier->bSide != pOpponent->bSide) && pSoldier->RecognizeAsCombatant(pOpponent->ubID) )
|
||||
if (pSoldier->bActive && pOpponent->bActive && !CONSIDERED_NEUTRAL( pOpponent, pSoldier ) && !CONSIDERED_NEUTRAL( pSoldier, pOpponent ) && (pSoldier->bSide != pOpponent->bSide) && pSoldier->RecognizeAsCombatant(pOpponent->ubID) )
|
||||
{
|
||||
RemoveOneOpponent(pSoldier);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user