mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
If ALLOW_TARGET_HEADANDLEG_IFPRONE is TRUE, head/torso/legs can be targetted on prone soldiers (until now, hits were always considered on torso).
Additionally soldiers are no longer protected from stray bullets in crouched and prone stance. This option will be removed once this code change has been accepted (or deemed unacceptable). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8264 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+22
-6
@@ -1687,13 +1687,33 @@ void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, FLOAT
|
||||
switch( pSoldier->bAimShotLocation )
|
||||
{
|
||||
case AIM_SHOT_HEAD:
|
||||
CalculateSoldierZPos( pTargetSoldier, HEAD_TARGET_POS, &dTargetZ );
|
||||
{
|
||||
CalculateSoldierZPos( pTargetSoldier, HEAD_TARGET_POS, &dTargetZ );
|
||||
|
||||
if ( gGameExternalOptions.fAllowTargetHeadAndLegIfProne && gAnimControl[pTargetSoldier->usAnimState].ubHeight == ANIM_PRONE )
|
||||
{
|
||||
INT32 viewdirectiongridno = NewGridNo( pTargetSoldier->sGridNo, DirectionInc( pTargetSoldier->ubDirection ) );
|
||||
|
||||
dTargetX = (0.3f * dTargetX + 0.7f * (FLOAT)CenterX( viewdirectiongridno )) / 1.0f;
|
||||
dTargetY = (0.3f * dTargetY + 0.7f * (FLOAT)CenterY( viewdirectiongridno )) / 1.0f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AIM_SHOT_TORSO:
|
||||
CalculateSoldierZPos( pTargetSoldier, TORSO_TARGET_POS, &dTargetZ );
|
||||
break;
|
||||
case AIM_SHOT_LEGS:
|
||||
CalculateSoldierZPos( pTargetSoldier, LEGS_TARGET_POS, &dTargetZ );
|
||||
{
|
||||
CalculateSoldierZPos( pTargetSoldier, LEGS_TARGET_POS, &dTargetZ );
|
||||
|
||||
if ( gGameExternalOptions.fAllowTargetHeadAndLegIfProne && gAnimControl[pTargetSoldier->usAnimState].ubHeight == ANIM_PRONE )
|
||||
{
|
||||
INT32 viewdirectiongridno = NewGridNo( pTargetSoldier->sGridNo, DirectionInc( gOppositeDirection[pTargetSoldier->ubDirection] ) );
|
||||
|
||||
dTargetX = (0.3f * dTargetX + 0.7f * (FLOAT)CenterX( viewdirectiongridno )) / 1.0f;
|
||||
dTargetY = (0.3f * dTargetY + 0.7f * (FLOAT)CenterY( viewdirectiongridno )) / 1.0f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// %)@#&(%?
|
||||
@@ -12565,10 +12585,6 @@ void GunIncreaseHeat( OBJECTTYPE *pObj, SOLDIERTYPE* pSoldier )
|
||||
FLOAT newguntemperature = min(guntemperature + singleshottemperature, OVERHEATING_MAX_TEMPERATURE ); // ... calculate new temperature ...
|
||||
|
||||
(*pObj)[0]->data.bTemperature = newguntemperature; // ... apply new temperature
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Gun temperature increased from %4.2f to %4.2f", guntemperature, newguntemperature );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user