- Fix: When targetting a tank, mercs always aim for the 'head'. This results in misses if one changes the tank's JSD to a lower silhouette.

- Fix: crash during loading of a game, as a tanks animation required sounds which were missing due to vehicle list not yet bein initialised
- Fix: soldier's damaged by a blast always receive at least 1 damage, even if damage calculation results in 0
- If vehicles destroy a wall, this can now bring down a building's roof

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8112 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-03-17 21:45:10 +00:00
parent 23d4051473
commit b8c0036396
5 changed files with 28 additions and 6 deletions
+4 -1
View File
@@ -2050,7 +2050,10 @@ BOOLEAN CalculateSoldierZPos( SOLDIERTYPE * pSoldier, UINT8 ubPosType, FLOAT * p
else if ( TANK( pSoldier ) ) else if ( TANK( pSoldier ) )
{ {
// high up! // high up!
ubPosType = HEAD_TARGET_POS; //ubPosType = HEAD_TARGET_POS;
// Flugente: why would we try to hit the top of a vehicle? the middle is just fine (we would also miss on vehicles with a lower silhouette)
ubPosType = TORSO_TARGET_POS;
} }
ubHeight = gAnimControl[ pSoldier->usAnimState ].ubEndHeight; ubHeight = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
+3 -2
View File
@@ -10485,7 +10485,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{ {
enemysidestrength += pSoldier->GetSurrenderStrength(); enemysidestrength += pSoldier->GetSurrenderStrength();
if ( pSoldier->ubProfile != NO_PROFILE || pSoldier->ubSoldierClass == SOLDIER_CLASS_TANK ) if ( pSoldier->ubProfile != NO_PROFILE || TANK(pSoldier) )
fNoSurrender = TRUE; fNoSurrender = TRUE;
} }
} }
@@ -10497,7 +10497,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
{ {
if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) ) if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
{ {
// if a civilian is not neutral and on the enemy side, add his strength to the team // hostile civs with a profile cannot be captured, as stated above, the entire team cannot surrender
if ( !pSoldier->aiData.bNeutral && pSoldier->bSide == 1 && zCivGroupName[pSoldier->ubCivilianGroup].fCanBeCaptured && pSoldier->ubProfile != NO_PROFILE ) if ( !pSoldier->aiData.bNeutral && pSoldier->bSide == 1 && zCivGroupName[pSoldier->ubCivilianGroup].fCanBeCaptured && pSoldier->ubProfile != NO_PROFILE )
fNoSurrender = TRUE; fNoSurrender = TRUE;
@@ -10505,6 +10505,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue )
if ( !pSoldier->CanBeCaptured() ) if ( !pSoldier->CanBeCaptured() )
continue; continue;
// if a civilian is not neutral and on the enemy side, add his strength to the team
enemysidestrength += pSoldier->GetSurrenderStrength( ); enemysidestrength += pSoldier->GetSurrenderStrength( );
} }
} }
+3 -1
View File
@@ -20939,7 +20939,9 @@ void InternalPlaySoldierFootstepSound( SOLDIERTYPE * pSoldier )
{ {
bVolume = HIGHVOLUME; bVolume = HIGHVOLUME;
} }
PlaySoldierJA2Sample( pSoldier->ubID, pVehicleList[pSoldier->bVehicleID].iMoveSound, RATE_11025, SoundVolume( bVolume, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ), TRUE );
if ( pVehicleList )
PlaySoldierJA2Sample( pSoldier->ubID, pVehicleList[pSoldier->bVehicleID].iMoveSound, RATE_11025, SoundVolume( bVolume, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ), TRUE );
} }
} }
+1 -1
View File
@@ -1843,7 +1843,7 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo
} }
} }
sNewWoundAmt = max(1, sNewWoundAmt); sNewWoundAmt = max(0, sNewWoundAmt);
} }
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
+17 -1
View File
@@ -1906,8 +1906,10 @@ BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason,
// max armour will be set by Player in .ini and checked before DamageStructure is called // max armour will be set by Player in .ini and checked before DamageStructure is called
if ( ubReason == STRUCTURE_DAMAGE_VEHICLE_TRAUMA ) if ( ubReason == STRUCTURE_DAMAGE_VEHICLE_TRAUMA )
{ {
INT16 damage = 255;
BOOLEAN recompile = FALSE; BOOLEAN recompile = FALSE;
ExplosiveDamageGridNo( sGridNo, 255, 10, &recompile, FALSE, -1, FALSE, ubOwner, 0 ); ExplosiveDamageGridNo( sGridNo, damage, 10, &recompile, FALSE, -1, FALSE, ubOwner, 0 );
//Since the structure is being damaged, set the map element that a structure is damaged //Since the structure is being damaged, set the map element that a structure is damaged
gpWorldLevelData[ sGridNo ].uiFlags |= MAPELEMENT_STRUCTURE_DAMAGED; gpWorldLevelData[ sGridNo ].uiFlags |= MAPELEMENT_STRUCTURE_DAMAGED;
@@ -1917,6 +1919,20 @@ BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason,
{ {
MercPtrs[ ubOwner ]->SoldierTakeDamage( 0, Random(max(0,(ubBaseArmour-10)/5))+max(0,(ubBaseArmour-10)/5), 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, MercPtrs[ ubOwner ]->sGridNo, 0, TRUE ); MercPtrs[ ubOwner ]->SoldierTakeDamage( 0, Random(max(0,(ubBaseArmour-10)/5))+max(0,(ubBaseArmour-10)/5), 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, MercPtrs[ ubOwner ]->sGridNo, 0, TRUE );
} }
// Flugente: if we destroyed a wall, the roof might get damaged too
// recompile = TRUE means that we destroyed something
if ( fWallHere && recompile )
{
// lets not make it that extreme
damage = 100;
HandleRoofDestruction( sGridNo, damage * 0.75f );
HandleRoofDestruction( NewGridNo( sGridNo, DirectionInc( NORTH ) ), damage * 0.75f );
HandleRoofDestruction( NewGridNo( sGridNo, DirectionInc( EAST ) ), damage * 0.75f );
HandleRoofDestruction( NewGridNo( sGridNo, DirectionInc( WEST ) ), damage * 0.75f );
HandleRoofDestruction( NewGridNo( sGridNo, DirectionInc( SOUTH ) ), damage * 0.75f );
}
} }
// Don't update damage HPs.... // Don't update damage HPs....