diff --git a/dlls/player.cpp b/dlls/player.cpp index 7941724d06..e8d8f30f44 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -740,7 +740,8 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl } } - pev->punchangle.x = -2; + if (!FBitSet(bitsDamageType, DMG_NO_PUNCH)) + pev->punchangle.x = -2; if( fTookDamage && !ftrivial && fmajor && flHealthPrev >= 75 ) { diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 4fca00c934..f0652f3061 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -56,6 +56,7 @@ #define SF_TRIGGER_HURT_AFFECT_NON_MOVING_MONSTERS 64 // hack to affect non-moving monsters #define SF_TRIGGER_HURT_FULL_DAMAGE_EVERY_HALF_SECOND 128 #define SF_TRIGGER_HURT_IGNORE_ARMOR 256 +#define SF_TRIGGER_HURT_NO_PUNCH 512 extern DLL_GLOBAL BOOL g_fGameOver; @@ -996,6 +997,8 @@ class CTriggerHurt : public CBaseTrigger } if (pev->spawnflags & SF_TRIGGER_HURT_IGNORE_ARMOR) damageType |= DMG_IGNORE_ARMOR; + if (pev->spawnflags & SF_TRIGGER_HURT_NO_PUNCH) + damageType |= DMG_NO_PUNCH; return damageType; } }; @@ -5075,6 +5078,7 @@ void CTriggerChangeClass::Affect(CBaseEntity *pEntity, USE_TYPE useType) #define SF_TRIGGER_HURT_REMOTE_STARTON 4 #define SF_TRIGGER_HURT_REMOTE_IGNORE_ARMOR 256 +#define SF_TRIGGER_HURT_REMOTE_NO_PUNCH 512 class CTriggerHurtRemote : public CPointEntity { @@ -5109,6 +5113,8 @@ class CTriggerHurtRemote : public CPointEntity } if (pev->spawnflags & SF_TRIGGER_HURT_REMOTE_IGNORE_ARMOR) damageType |= DMG_IGNORE_ARMOR; + if (pev->spawnflags & SF_TRIGGER_HURT_REMOTE_NO_PUNCH) + damageType |= DMG_NO_PUNCH; return damageType; } float Delay() const { return pev->frags ? pev->frags : 0.1; } diff --git a/fgd/halflife.fgd b/fgd/halflife.fgd index 7634806546..80cc971fcc 100644 --- a/fgd/halflife.fgd +++ b/fgd/halflife.fgd @@ -7523,6 +7523,7 @@ 64:"Affect non-moving NPC's" : 0 : "Uses entity's bounding box to find and hurt non-moving monsters. Will produce wrong results on non-cuboid brush shapes." 128:"Full dmg every 0.5 seconds" : 0 : "Do full damage (or healing) instead of halving the value. Recommended to use with odd values." 256:"Ignore Armor" : 0 + 512:"No Camera Punch" : 0 ] master(string) : "Master" dmg(integer) : "Damage" : 10 : "The damage is applied every 0.5 seconds. Negative value means healing. The value is getting halved, unless 'Full dmg every 0.5 seconds' spawnflag is set." @@ -7539,6 +7540,7 @@ 2 : "Constant" : 0 4 : "Start On" : 0 256:"Ignore Armor" : 0 + 512:"No Camera Punch" : 0 ] target(string) : "Target [LE]" targetclass(string) : "Target Class" : : "If specified, all entities with the given class will be affected. This is independent from Target, which means the entity might cause damage twice to the same entity if Target is class of Target Class." diff --git a/game_shared/dmg_types.h b/game_shared/dmg_types.h index a62cdd2ba4..494ebe0c12 100644 --- a/game_shared/dmg_types.h +++ b/game_shared/dmg_types.h @@ -39,6 +39,7 @@ #define DMG_TIMEDNONLETHAL (1 << 25) // timed damage, e.g. poison, shouldn't kill player completely #define DMG_DONTBLEED (1 << 26) // used in TraceAttack. Force not to bleed. #define DMG_IGNORE_ARMOR (1 << 27) +#define DMG_NO_PUNCH (1 << 28) // Modifiers to time-based damage, up to 8 #define DMG_TIMED_MOD_NONLETHAL ( 1 << 0 )