本文整理汇总了C++中CGameRules::ClientHit方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameRules::ClientHit方法的具体用法?C++ CGameRules::ClientHit怎么用?C++ CGameRules::ClientHit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameRules
的用法示例。
在下文中一共展示了CGameRules::ClientHit方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessHit
//------------------------------------------------------------------------
void CCannonBall::ProcessHit(CGameRules& gameRules, const EventPhysCollision& collision, IEntity& target, float damage, int hitMatId, const Vec3& hitDir)
{
if(damage > 0.f)
{
EntityId targetId = target.GetId();
bool alreadyHit = CheckForPreviousHit(targetId, damage);
if(!alreadyHit)
{
HitInfo hitInfo(m_ownerId ? m_ownerId : m_hostId, targetId, m_weaponId,
damage, 0.0f, hitMatId, collision.partid[1],
m_hitTypeId, collision.pt, hitDir, collision.n);
hitInfo.remote = IsRemote();
hitInfo.projectileId = GetEntityId();
hitInfo.bulletType = m_pAmmoParams->bulletType;
hitInfo.knocksDown = CheckAnyProjectileFlags(ePFlag_knocksTarget) && ( damage > m_minDamageForKnockDown );
hitInfo.knocksDownLeg = m_chanceToKnockDownLeg>0 && damage>m_minDamageForKnockDownLeg && m_chanceToKnockDownLeg>(int)Random(100);
hitInfo.penetrationCount = m_penetrationCount;
hitInfo.hitViaProxy = CheckAnyProjectileFlags(ePFlag_firedViaProxy);
hitInfo.aimed = CheckAnyProjectileFlags(ePFlag_aimedShot);
IPhysicalEntity* pPhysicalEntity = collision.pEntity[1];
if (pPhysicalEntity && pPhysicalEntity->GetType() == PE_ROPE)
{
hitInfo.partId = GetRopeBoneId(collision, target, pPhysicalEntity);
}
gameRules.ClientHit(hitInfo);
ReportHit(targetId);
}
}
}
示例2: HandleEvent
//------------------------------------------------------------------------
void CRock::HandleEvent(const SGameObjectEvent &event)
{
CProjectile::HandleEvent(event);
if (event.event == eGFE_OnCollision)
{
if (m_destroying)
return;
EventPhysCollision *pCollision = reinterpret_cast<EventPhysCollision *>(event.ptr);
if (!pCollision)
return;
IEntity *pTarget = pCollision->iForeignData[1]==PHYS_FOREIGN_ID_ENTITY ? (IEntity*)pCollision->pForeignData[1]:0;
if (!pTarget || pTarget->GetId()==m_ownerId || pTarget->GetId()==GetEntityId())
return;
Vec3 dir(0, 0, 0);
if (pCollision->vloc[0].GetLengthSquared() > 1e-6f)
dir = pCollision->vloc[0].GetNormalized();
CGameRules *pGameRules = g_pGame->GetGameRules();
HitInfo hitInfo(m_ownerId, pTarget?pTarget->GetId():0, m_weaponId,
m_fmId, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(pCollision->idmat[1]), pCollision->partid[1],
pGameRules->GetHitTypeId("melee"), pCollision->pt, dir, pCollision->n);
hitInfo.remote = IsRemote();
hitInfo.projectileId = GetEntityId();
if (!hitInfo.remote)
hitInfo.seq=m_seq;
hitInfo.damage = m_damage;
if (m_weaponId)
{
CWeapon *pWeapon=GetWeapon();
if (pWeapon && pWeapon->GetForcedHitMaterial() != -1)
hitInfo.material=pGameRules->GetHitMaterialIdFromSurfaceId(pWeapon->GetForcedHitMaterial());
}
pGameRules->ClientHit(hitInfo);
if(m_damage>10)
m_damage =(int)(m_damage*0.5f);
}
}
示例3: ApplySurroundingDamage
void CBurnEffectManager::ApplySurroundingDamage(float deltaTime)
{
const float damageTime = 0.5f;
m_damageTimeOut -= deltaTime;
if (m_damageTimeOut > 0.0f)
return;
m_damageTimeOut += damageTime;
CGameRules* pGameRules = g_pGame->GetGameRules();
if (pGameRules)
{
for (TBurnPoints::iterator it = m_burnPoints.begin(); it != m_burnPoints.end(); ++it)
{
const int hitType = it->m_hitType;
const float damagePerSecond =
it->m_shootByPlayer ?
it->m_pBurnParams->m_damagePerSecond :
it->m_pBurnParams->m_damagePerSecond_AI;
const float damage = damagePerSecond * damageTime * it->m_accumulation;
if (damage == 0.0f)
continue;
const Vec3 radius = Vec3(it->m_radius, it->m_radius, it->m_radius);
SEntityProximityQuery query;
query.box.min = it->m_position - radius;
query.box.max = it->m_position + radius;
gEnv->pEntitySystem->QueryProximity(query);
for (int i = 0; i < query.nCount; ++i)
{
if (IEntity* pEntity = query.pEntities[i])
{
if (ShouldBurnPointInflictDamageOntoEntity(*it, pEntity))
{
HitInfo hitInfo(0, pEntity->GetId(), 0,
damagePerSecond, 0.0f, 0, 0,
hitType, it->m_position, Vec3(ZERO), Vec3(ZERO));
pGameRules->ClientHit(hitInfo);
}
}
}
}
}
}
示例4: ProcessEvent
void CDangerousRigidBody::ProcessEvent( SEntityEvent& event )
{
switch(event.event)
{
case ENTITY_EVENT_COLLISION:
{
if(m_dangerous)
{
EventPhysCollision *pCollision = (EventPhysCollision *)(event.nParam[0]);
if(pCollision->pEntity[0] && pCollision->pEntity[1])
{
IPhysicalEntity* pOtherEntityPhysics = GetEntity()->GetPhysics() != pCollision->pEntity[0] ? pCollision->pEntity[0] : pCollision->pEntity[1];
if( IEntity* pOtherEntity = gEnv->pEntitySystem->GetEntityFromPhysics(pOtherEntityPhysics) )
{
EntityId localClientId = gEnv->pGame->GetIGameFramework()->GetClientActorId();
if(pOtherEntity->GetId() == localClientId) //Handle collision locally
{
float currentTime = gEnv->pTimer->GetFrameStartTime().GetSeconds();
if(currentTime - m_lastHitTime > m_timeBetweenHits)
{
CGameRules* pGameRules = g_pGame->GetGameRules();
bool sameTeam = m_activatorTeam && (pGameRules->GetTeam(localClientId) == m_activatorTeam);
float damageDealt = !sameTeam ? m_damageDealt : g_pGameCVars->g_friendlyfireratio * m_damageDealt;
Vec3 rigidBodyPos = GetEntity()->GetWorldPos();
HitInfo hitInfo(0, localClientId, 0,
damageDealt, 0.0f, 0, 0,
sDangerousRigidBodyHitTypeId, rigidBodyPos, (pOtherEntity->GetWorldPos()-rigidBodyPos).GetNormalized(), Vec3(ZERO));
pGameRules->ClientHit(hitInfo);
m_lastHitTime = currentTime;
}
}
}
}
}
}
break;
case ENTITY_EVENT_RESET:
{
Reset();
}
break;
}
}
示例5: ApplyHit
void CWaterPuddle::ApplyHit(const SActorData& actorData, EntityId shooterId, EntityId weaponId, float damage, int hitTypeId, float waterLevel, IParticleEffect* hitEffect)
{
CGameRules* pGameRules = g_pGame->GetGameRules();
const Vec3 hitPosition = actorData.position + Vec3Constants<float>::fVec3_OneZ;
const Vec3 hitDirection = hitPosition.GetNormalized();
HitInfo hitInfo(shooterId, actorData.entityId, weaponId,
damage, 0.0f, -1, -1,
hitTypeId, hitPosition, hitDirection,
-hitDirection);
hitInfo.projectileId = GetEntityId();
hitInfo.aimed = false;
pGameRules->ClientHit(hitInfo);
const EntityEffects::SEffectSpawnParams effectSpawnParams(Vec3(actorData.position.x, actorData.position.y, waterLevel));
EntityEffects::SpawnParticleFX(hitEffect, effectSpawnParams);
}
示例6: HandleEvent
void CTacBullet::HandleEvent(const SGameObjectEvent &event)
{
if (m_destroying)
return;
CProjectile::HandleEvent(event);
if (event.event == eGFE_OnCollision)
{
EventPhysCollision *pCollision = reinterpret_cast<EventPhysCollision *>(event.ptr);
if (!pCollision)
return;
IEntity *pTarget = pCollision->iForeignData[1]==PHYS_FOREIGN_ID_ENTITY ? (IEntity*)pCollision->pForeignData[1]:0;
if (pTarget)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
EntityId targetId = pTarget->GetId();
CActor *pActor = (CActor *)gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(targetId);
if(pActor && pActor->CanSleep())
{
if(pActor->GetLinkedVehicle() && !gEnv->bMultiplayer)
{
SleepTargetInVehicle(m_ownerId,pActor);
}
else if(IEntity* pOwnerEntity = gEnv->pEntitySystem->GetEntity(m_ownerId))
{
if (pTarget->GetAI() && !pTarget->GetAI()->IsFriendly(pOwnerEntity->GetAI(), false))
{
float sleepTime = 30.0f;
if(m_pAmmoParams)
sleepTime = m_pAmmoParams->sleepTime;
SimpleHitInfo info(m_ownerId, targetId, m_weaponId, 1, sleepTime); // 0=tag,1=tac
info.remote=IsRemote();
pGameRules->ClientSimpleHit(info);
}
}
}
else
{
Vec3 dir(0, 0, 0);
if (pCollision->vloc[0].GetLengthSquared() > 1e-6f)
dir = pCollision->vloc[0].GetNormalized();
HitInfo hitInfo(m_ownerId, pTarget->GetId(), m_weaponId,
(float)m_damage, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(pCollision->idmat[1]), pCollision->partid[1],
m_hitTypeId, pCollision->pt, dir, pCollision->n);
hitInfo.remote = IsRemote();
hitInfo.projectileId = GetEntityId();
hitInfo.bulletType = m_pAmmoParams->bulletType;
pGameRules->ClientHit(hitInfo);
}
}
else if (pCollision->pEntity[0]->GetType() == PE_PARTICLE)
{
float bouncy, friction;
uint32 pierceabilityMat;
gEnv->pPhysicalWorld->GetSurfaceParameters(pCollision->idmat[1], bouncy, friction, pierceabilityMat);
pierceabilityMat&=sf_pierceable_mask;
pe_params_particle params;
if(pCollision->pEntity[0]->GetParams(¶ms)==0)
SetDefaultParticleParams(¶ms);
if (pierceabilityMat>params.iPierceability && pCollision->idCollider!=-1)
return;
}
Destroy();
}
}
示例7: HandleEvent
//------------------------------------------------------------------------
void CBullet::HandleEvent(const SGameObjectEvent &event)
{
FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);
CProjectile::HandleEvent(event);
if (event.event == eGFE_OnCollision)
{
if (m_destroying)
return;
EventPhysCollision *pCollision = reinterpret_cast<EventPhysCollision *>(event.ptr);
if (!pCollision)
return;
IEntity *pTarget = pCollision->iForeignData[1]==PHYS_FOREIGN_ID_ENTITY ? (IEntity*)pCollision->pForeignData[1]:0;
//Only process hits that have a target
if(pTarget)
{
Vec3 dir(0, 0, 0);
if (pCollision->vloc[0].GetLengthSquared() > 1e-6f)
dir = pCollision->vloc[0].GetNormalized();
CGameRules *pGameRules = g_pGame->GetGameRules();
IActor* pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(m_ownerId);
bool ok = true;
if(!gEnv->bMultiplayer && pActor && pActor->IsPlayer())
{
IActor* pAITarget = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pTarget->GetId());
if(pAITarget && pTarget->GetAI() && pTarget->GetAI()->IsFriendly(pActor->GetEntity()->GetAI(), false))
{
pGameRules->SetEntityToIgnore(pTarget->GetId());
ok = false;
}
}
if(ok)
{
HitInfo hitInfo(m_ownerId, pTarget->GetId(), m_weaponId,
(float)m_damage, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(pCollision->idmat[1]), pCollision->partid[1],
m_hitTypeId, pCollision->pt, dir, pCollision->n);
hitInfo.remote = IsRemote();
hitInfo.projectileId = GetEntityId();
hitInfo.bulletType = m_pAmmoParams->bulletType;
pGameRules->ClientHit(hitInfo);
// Notify AI
if (gEnv->pAISystem && !gEnv->bMultiplayer)
{
static int htMelee = pGameRules->GetHitTypeId("melee");
if (m_ownerId && m_hitTypeId != htMelee)
{
ISurfaceType *pSurfaceType = pGameRules->GetHitMaterial(hitInfo.material);
const ISurfaceType::SSurfaceTypeAIParams* pParams = pSurfaceType ? pSurfaceType->GetAIParams() : 0;
const float radius = pParams ? pParams->fImpactRadius : 2.5f;
const float soundRadius = pParams ? pParams->fImpactSoundRadius : 20.0f;
// Associate event with vehicle if the shooter is in a vehicle (tank cannon shot, etc)
EntityId ownerId = m_ownerId;
if (pActor && pActor->GetLinkedVehicle() && pActor->GetLinkedVehicle()->GetEntityId())
ownerId = pActor->GetLinkedVehicle()->GetEntityId();
SAIStimulus stim(AISTIM_BULLET_HIT, 0, ownerId, 0, pCollision->pt, ZERO, radius);
gEnv->pAISystem->RegisterStimulus(stim);
SAIStimulus stimSound(AISTIM_SOUND, AISOUND_COLLISION_LOUD, ownerId, 0, pCollision->pt, ZERO, soundRadius, AISTIMPROC_FILTER_LINK_WITH_PREVIOUS);
gEnv->pAISystem->RegisterStimulus(stimSound);
}
}
}
}
else
{
// Notify AI
// The above case only catches entity vs. entity hits, the AI is interested in all hits.
if (gEnv->pAISystem && !gEnv->bMultiplayer)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
static int htMelee = pGameRules->GetHitTypeId("melee");
if (m_ownerId && m_hitTypeId != htMelee)
{
int material = pGameRules->GetHitMaterialIdFromSurfaceId(pCollision->idmat[1]);
ISurfaceType *pSurfaceType = pGameRules->GetHitMaterial(material);
const ISurfaceType::SSurfaceTypeAIParams* pParams = pSurfaceType ? pSurfaceType->GetAIParams() : 0;
const float radius = pParams ? pParams->fImpactRadius : 2.5f;
const float soundRadius = pParams ? pParams->fImpactSoundRadius : 20.0f;
// Associate event with vehicle if the shooter is in a vehicle (tank cannon shot, etc)
EntityId ownerId = m_ownerId;
IActor* pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(m_ownerId);
if (pActor && pActor->GetLinkedVehicle() && pActor->GetLinkedVehicle()->GetEntityId())
//.........这里部分代码省略.........
示例8: Hit
//------------------------------------------------------------------------
void CMelee::Hit(const Vec3 &pt, const Vec3 &dir, const Vec3 &normal, IPhysicalEntity *pCollider, int partId, int ipart, int surfaceIdx, float damageScale, bool remote)
{
// generate the damage
IEntity *pTarget = gEnv->pEntitySystem->GetEntityFromPhysics(pCollider);
// Report punch to AI system.
// The AI notification must come before the game rules are
// called so that the death handler in AIsystem understands that the hit
// came from the player.
bool ok = true;
if(pTarget)
{
CActor *pActor = m_pWeapon->GetOwnerActor();
if(!gEnv->bMultiplayer && pActor && pActor->IsPlayer())
{
if (IActor *pAITarget = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pTarget->GetId()))
{
if (IAIObject *pAITargetObject = pTarget->GetAI())
{
if (pAITargetObject->IsFriendly(pActor->GetEntity()->GetAI(), false))
{
ok = false;
m_noImpulse = true;
}
}
}
}
if(ok)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
HitInfo info(m_pWeapon->GetOwnerId(), pTarget->GetId(), m_pWeapon->GetEntityId(),
m_pShared->meleeparams.damage * damageScale * m_meleeScale, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(surfaceIdx), partId,
pGameRules->GetHitTypeId(m_pShared->meleeparams.hit_type.c_str()), pt, dir, normal);
info.remote = remote;
pGameRules->ClientHit(info);
}
}
// play effects
if(ok)
{
if(IMaterialEffects *pMaterialEffects = gEnv->pGame->GetIGameFramework()->GetIMaterialEffects())
{
TMFXEffectId effectId = pMaterialEffects->GetEffectId("melee", surfaceIdx);
if (effectId != InvalidEffectId)
{
SMFXRunTimeEffectParams params;
params.pos = pt;
params.normal = -dir;
params.playflags = MFX_PLAY_ALL | MFX_DISABLE_DELAY;
params.soundSemantic = eSoundSemantic_Player_Foley;
pMaterialEffects->ExecuteEffect(effectId, params);
}
}
}
ApplyCameraShake(true);
m_pWeapon->PlayAction(m_pShared->meleeactions.hit.c_str());
}
示例9: Hit
//------------------------------------------------------------------------
void CMelee::Hit(const Vec3 &pt, const Vec3 &dir, const Vec3 &normal, IPhysicalEntity *pCollider, int partId, int ipart, int surfaceIdx, float damageScale, bool remote)
{
// generate the damage
IEntity *pTarget = gEnv->pEntitySystem->GetEntityFromPhysics(pCollider);
// Report punch to AI system.
// The AI notification must come before the game rules are
// called so that the death handler in AIsystem understands that the hit
// came from the player.
CActor *pActor = m_pWeapon->GetOwnerActor();
if (pActor && pActor->GetActorClass() == CPlayer::GetActorClassType())
{
CPlayer *pPlayer = (CPlayer *)pActor;
if (pPlayer && pPlayer->GetNanoSuit())
{
if (pPlayer->GetEntity() && pPlayer->GetEntity()->GetAI())
{
SAIEVENT AIevent;
AIevent.targetId = pTarget ? pTarget->GetId() : 0;
// pPlayer->GetNanoSuit()->GetMode() == NANOMODE_STRENGTH
pPlayer->GetEntity()->GetAI()->Event(AIEVENT_PLAYER_STUNT_PUNCH, &AIevent);
}
}
}
bool ok = true;
if(pTarget)
{
if(!gEnv->bMultiplayer && pActor && pActor->IsPlayer())
{
IActor* pAITarget = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pTarget->GetId());
if(pAITarget && pTarget->GetAI() && !pTarget->GetAI()->IsHostile(pActor->GetEntity()->GetAI(),false))
{
ok = false;
m_noImpulse = true;
}
}
if(ok)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
HitInfo info(m_pWeapon->GetOwnerId(), pTarget->GetId(), m_pWeapon->GetEntityId(),
m_meleeparams.damage*damageScale*m_meleeScale, 0.0f, pGameRules->GetHitMaterialIdFromSurfaceId(surfaceIdx), partId,
pGameRules->GetHitTypeId(m_meleeparams.hit_type.c_str()), pt, dir, normal);
info.remote = remote;
if (m_pWeapon->GetForcedHitMaterial() != -1)
info.material=pGameRules->GetHitMaterialIdFromSurfaceId(m_pWeapon->GetForcedHitMaterial());
pGameRules->ClientHit(info);
}
}
// play effects
if(ok)
{
IMaterialEffects* pMaterialEffects = gEnv->pGame->GetIGameFramework()->GetIMaterialEffects();
TMFXEffectId effectId = pMaterialEffects->GetEffectId("melee", surfaceIdx);
if (effectId != InvalidEffectId)
{
SMFXRunTimeEffectParams params;
params.pos = pt;
params.playflags = MFX_PLAY_ALL | MFX_DISABLE_DELAY;
params.soundSemantic = eSoundSemantic_Player_Foley;
pMaterialEffects->ExecuteEffect(effectId, params);
}
}
ApplyCameraShake(true);
m_pWeapon->PlayAction(m_meleeactions.hit.c_str());
}
示例10: Hit
//.........这里部分代码省略.........
ITargetTrackManager *pTargetTrackManager = pAISystem ? pAISystem->GetTargetTrackManager() : NULL;
if (pTargetTrackManager && pOwnerAI)
{
IAIObject *pTargetAI = pTarget ? pTarget->GetAI() : NULL;
if (pTargetAI)
{
const tAIObjectID aiOwnerId = pOwnerAI->GetAIObjectID();
const tAIObjectID aiTargetId = pTargetAI->GetAIObjectID();
TargetTrackHelpers::SStimulusEvent eventInfo;
eventInfo.vPos = pt;
eventInfo.eStimulusType = TargetTrackHelpers::eEST_Generic;
eventInfo.eTargetThreat = AITHREAT_AGGRESSIVE;
pTargetTrackManager->HandleStimulusEventForAgent(aiTargetId, aiOwnerId, "MeleeHit",eventInfo);
pTargetTrackManager->HandleStimulusEventInRange(aiOwnerId, "MeleeHitNear", eventInfo, 5.0f);
}
}
}
//Check if is a friendly hit, in that case FX and Hit will be skipped
bool isFriendlyHit = (pOwnerEntity && pTarget) ? IsFriendlyHit(pOwnerEntity, pTarget) : false;
if(!isFriendlyHit)
{
CPlayer * pAttackerPlayer = pOwnerActor->IsPlayer() ? static_cast<CPlayer*>(pOwnerActor) : NULL;
float damage = m_pMeleeParams->meleeparams.damage_ai;
if(pOwnerActor->IsPlayer())
{
damage = m_slideKick ? m_pMeleeParams->meleeparams.slide_damage : GetMeleeDamage();
}
#ifndef _RELEASE
if (pTargetActor && g_pGameCVars->g_LogDamage)
{
CryLog ("[DAMAGE] %s '%s' is%s meleeing %s '%s' applying damage = %.3f x %.3f = %.3f",
pOwnerActor->GetEntity()->GetClass()->GetName(), pOwnerActor->GetEntity()->GetName(), silentHit ? " silently" : "",
pTargetActor->GetEntity()->GetClass()->GetName(), pTargetActor->GetEntity()->GetName(),
damage, damageScale, damage * damageScale);
}
#endif
//Generate Hit
if(pTarget)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
CRY_ASSERT_MESSAGE(pGameRules, "No game rules! Melee can not apply hit damage");
if (pGameRules)
{
hitTypeID = silentHit ? CGameRules::EHitType::SilentMelee : m_hitTypeID;
HitInfo info(m_pWeapon->GetOwnerId(), pTarget->GetId(), m_pWeapon->GetEntityId(),
damage * damageScale, 0.0f, surfaceIdx, partId, hitTypeID, pt, dir, normal);
if (m_pMeleeParams->meleeparams.knockdown_chance>0 && Random(100) < m_pMeleeParams->meleeparams.knockdown_chance)
info.knocksDown = true;
info.remote = remote;
pGameRules->ClientHit(info);
}
if (pAttackerPlayer && pAttackerPlayer->IsClient())
{
const Vec3 posOffset = (pt - pTarget->GetWorldPos());
SMeleeHitParams params;
params.m_boostedMelee = false;
params.m_hitNormal = normal;
params.m_hitOffset = posOffset;
params.m_surfaceIdx = surfaceIdx;
params.m_targetId = pTarget->GetId();
pAttackerPlayer->OnMeleeHit(params);
}
}
else
{
//Play Material FX
PlayHitMaterialEffect(pt, normal, false, surfaceIdx);
}
}
if (pTarget)
{
CActor *pCTargetActor = static_cast<CActor*>(pTargetActor);
CPlayer* pTargetPlayer = (pTargetActor && pTargetActor->IsPlayer()) ? static_cast<CPlayer*>(pTargetActor) : NULL;
if(pTargetPlayer && pTargetPlayer->IsClient())
{
if(m_pMeleeParams->meleeparams.trigger_client_reaction)
{
pTargetPlayer->TriggerMeleeReaction();
}
}
}
}
return hitTypeID;
}