mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-09-25 05:41:42 +02:00
Fix sniper bug / bulletInfoInUse counting
This commit is contained in:
@@ -126,6 +126,28 @@ void CBulletInfo::Update(void)
|
|||||||
}
|
}
|
||||||
pPed->InflictDamage(pBullet->m_pSource, pBullet->m_eWeaponType, pBullet->m_nDamage, (ePedPieceTypes)point.pieceB, pPed->GetLocalDirection(pPed->GetPosition() - point.point));
|
pPed->InflictDamage(pBullet->m_pSource, pBullet->m_eWeaponType, pBullet->m_nDamage, (ePedPieceTypes)point.pieceB, pPed->GetLocalDirection(pPed->GetPosition() - point.point));
|
||||||
CEventList::RegisterEvent(pPed->m_nPedType == PEDTYPE_COP ? EVENT_SHOOT_COP : EVENT_SHOOT_PED, EVENT_ENTITY_PED, pPed, (CPed*)pBullet->m_pSource, 1000);
|
CEventList::RegisterEvent(pPed->m_nPedType == PEDTYPE_COP ? EVENT_SHOOT_COP : EVENT_SHOOT_PED, EVENT_ENTITY_PED, pPed, (CPed*)pBullet->m_pSource, 1000);
|
||||||
|
|
||||||
|
if (CGame::nastyGame) {
|
||||||
|
CVector vecParticleDirection = (point.point - pPed->GetPosition()) * 0.01f;
|
||||||
|
vecParticleDirection.z = 0.01f;
|
||||||
|
if (pPed->GetIsOnScreen()) {
|
||||||
|
for (int j = 0; j < NUM_PED_BLOOD_PARTICLES; j++)
|
||||||
|
CParticle::AddParticle(PARTICLE_BLOOD_SMALL, point.point + BLOOD_PARTICLE_OFFSET, vecParticleDirection);
|
||||||
|
}
|
||||||
|
if (pPed->GetPedState() == PED_DEAD) {
|
||||||
|
CAnimBlendAssociation* pAnim;
|
||||||
|
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL))
|
||||||
|
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f);
|
||||||
|
else
|
||||||
|
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f);
|
||||||
|
if (pAnim) {
|
||||||
|
pAnim->SetCurrentTime(0.0f);
|
||||||
|
pAnim->flags |= ASSOC_RUNNING;
|
||||||
|
pAnim->flags &= ~ASSOC_FADEOUTWHENDONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pBullet->m_bInUse = false;
|
pBullet->m_bInUse = false;
|
||||||
#ifdef SQUEEZE_PERFORMANCE
|
#ifdef SQUEEZE_PERFORMANCE
|
||||||
bulletInfoInUse--;
|
bulletInfoInUse--;
|
||||||
@@ -136,31 +158,6 @@ void CBulletInfo::Update(void)
|
|||||||
bAddSound = false;
|
bAddSound = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CGame::nastyGame) {
|
|
||||||
CVector vecParticleDirection = (point.point - pPed->GetPosition()) * 0.01f;
|
|
||||||
vecParticleDirection.z = 0.01f;
|
|
||||||
if (pPed->GetIsOnScreen()) {
|
|
||||||
for (int j = 0; j < NUM_PED_BLOOD_PARTICLES; j++)
|
|
||||||
CParticle::AddParticle(PARTICLE_BLOOD_SMALL, point.point + BLOOD_PARTICLE_OFFSET, vecParticleDirection);
|
|
||||||
}
|
|
||||||
if (pPed->GetPedState() == PED_DEAD) {
|
|
||||||
CAnimBlendAssociation* pAnim;
|
|
||||||
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL))
|
|
||||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR_FRONT, 8.0f);
|
|
||||||
else
|
|
||||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_STD_HIT_FLOOR, 8.0f);
|
|
||||||
if (pAnim) {
|
|
||||||
pAnim->SetCurrentTime(0.0f);
|
|
||||||
pAnim->flags |= ASSOC_RUNNING;
|
|
||||||
pAnim->flags &= ~ASSOC_FADEOUTWHENDONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pBullet->m_bInUse = false;
|
|
||||||
#ifdef SQUEEZE_PERFORMANCE
|
|
||||||
bulletInfoInUse--;
|
|
||||||
#endif
|
|
||||||
vecNewPos = point.point;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (pHitEntity->IsVehicle()) {
|
else if (pHitEntity->IsVehicle()) {
|
||||||
CVehicle* pVehicle = (CVehicle*)pHitEntity;
|
CVehicle* pVehicle = (CVehicle*)pHitEntity;
|
||||||
|
Reference in New Issue
Block a user