mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- new ini option ZOMBIE_ONLY_HEADSHOTS_PERMANENTLY_KILL: if a zombie is killed via headshot/melee combat, he can't rise again
- new ini option FOOD_MAX_POISONING: determines the maximum amount of food poisoning eating a singel food item can give - fixed a bug that caused tooltips to display the wrong traits - fixed a few zombie-related bugs git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5669 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+23
-2
@@ -8866,11 +8866,20 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
|
||||
UINT8 ubAmmoType;
|
||||
|
||||
#ifdef ENABLE_ZOMBIES
|
||||
if ( pTarget->IsZombie() && gGameExternalOptions.fZombieOnlyHeadshotsWork )
|
||||
if ( pTarget->IsZombie() )
|
||||
{
|
||||
// if bullet does not hits anything other than the head, it doesn't do any damage
|
||||
if ( ubHitLocation != AIM_SHOT_HEAD )
|
||||
if ( gGameExternalOptions.fZombieOnlyHeadshotsWork && ubHitLocation != AIM_SHOT_HEAD )
|
||||
return 0;
|
||||
|
||||
// set a flag if this was a headshot, unset if it wasn't. Thus we can determine if this was a headshot kill (only if life > 0, ignore if already dead)
|
||||
if ( gGameExternalOptions.fZombieOnlyHeadShotsPermanentlyKill && pTarget->stats.bLife > 0 )
|
||||
{
|
||||
if ( ubHitLocation == AIM_SHOT_HEAD )
|
||||
pTarget->bSoldierFlagMask |= SOLDIER_HEADSHOT;
|
||||
else
|
||||
pTarget->bSoldierFlagMask &= ~SOLDIER_HEADSHOT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9738,6 +9747,18 @@ INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BO
|
||||
BOOLEAN autoresolve = IsAutoResolveActive();
|
||||
iImpact = max( 1, (INT32)(iImpact * (100 - pTarget->GetDamageResistance(autoresolve, FALSE)) / 100 ) );
|
||||
|
||||
#ifdef ENABLE_ZOMBIES
|
||||
// Flugente: if the target is a zombie, any melee attack, regardless of hit location, will set the headshot flag. Thus any zombie killed in melee will stay dead (if you play with that option)
|
||||
if ( pTarget->IsZombie() )
|
||||
{
|
||||
// set a flag if this was a headshot, unset if it wasn't. Thus we can determine if this was a headshot kill (only if life > 0, ignore if already dead)
|
||||
if ( gGameExternalOptions.fZombieOnlyHeadShotsPermanentlyKill && pTarget->stats.bLife > 0 )
|
||||
{
|
||||
pTarget->bSoldierFlagMask |= SOLDIER_HEADSHOT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return( iImpact );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user