FF Diff Viewer

Comparing 2006 Base SDK to Fortress Forever 2.46

game_shared/takedamageinfo.cpp

91011121314
#include "takedamageinfo.h" #include "ammodef.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h"
910111213141516171819
#include "takedamageinfo.h" #include "ammodef.h" #ifdef GAME_DLL #include "ff_entity_system.h" #include "ff_lualib_constants.h" #endif // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h"
28293031323334
DEFINE_FIELD( m_iAmmoType, FIELD_INTEGER), END_DATADESC() void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, const Vector &damageForce, const Vector &damagePosition, const Vector &reportedPosition, float flDamage, int bitsDamageType, int iKillType ) { m_hInflictor = pInflictor; if ( pAttacker )
33343536373839
DEFINE_FIELD( m_iAmmoType, FIELD_INTEGER), END_DATADESC() void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, const Vector &damageForce, const Vector &damagePosition, const Vector &reportedPosition, float flDamage, int bitsDamageType, int iKillType) { m_hInflictor = pInflictor; if ( pAttacker )
298299300301302303304305
Vector vecForce = vecBulletDir; VectorNormalize( vecForce ); vecForce *= GetAmmoDef()->DamageForce( iBulletType ); vecForce *= phys_pushscale.GetFloat(); vecForce *= flScale; info->SetDamageForce( vecForce ); }
303304305306307308309310
Vector vecForce = vecBulletDir; VectorNormalize( vecForce ); vecForce *= GetAmmoDef()->DamageForce( iBulletType ); vecForce *= 10.0f * phys_pushscale.GetFloat(); // |-- Mirv: Keep us consistent with hl2 & other mods info->SetDamageForce( vecForce ); }
311312313314315316317
info->SetDamagePosition( vecForceOrigin ); // Calculate an impulse large enough to push a 75kg man 4 in/sec per point of damage float flForceScale = info->GetBaseDamage() * ImpulseScale( 75, 4 ); Vector vecForce = vecMeleeDir; VectorNormalize( vecForce ); vecForce *= flForceScale;
316317318319320321322
info->SetDamagePosition( vecForceOrigin ); // Calculate an impulse large enough to push a 75kg man 4 in/sec per point of damage float flForceScale = info->GetBaseDamage() * ImpulseScale( 75, .2 ); Vector vecForce = vecMeleeDir; VectorNormalize( vecForce ); vecForce *= flForceScale;
340341342
CalculateMeleeDamageForce( info, vecForceDir, vecForceOrigin, flScale ); } }
345346347348349350351352353354355356357
CalculateMeleeDamageForce( info, vecForceDir, vecForceOrigin, flScale ); } } #ifdef GAME_DLL //----------------------------------------------------------------------------- // Purpose: Convert ammo type to lua range //----------------------------------------------------------------------------- int CTakeDamageInfo::GetAmmoTypeLua( void ) { return LookupAmmoLua( GetAmmoType() ); } #endif