Call TakeDamage on projectile and laser hit (gun, shotgun and laser)

The grenade and hammer already triggered TakeDamage
now all weapons hitting a tee call the method again
This commit is contained in:
ChillerDragon 2024-08-31 19:16:26 +08:00
parent 6ab597a465
commit f8a4e7dbab
2 changed files with 3 additions and 0 deletions

View file

@ -94,6 +94,7 @@ bool CLaser::HitCharacter(vec2 From, vec2 To)
{ {
pHit->UnFreeze(); pHit->UnFreeze();
} }
pHit->TakeDamage(vec2(0, 0), 0, m_Owner, m_Type);
return true; return true;
} }

View file

@ -177,6 +177,8 @@ void CProjectile::Tick()
pChr->Freeze(); pChr->Freeze();
} }
} }
else if(pTargetChr)
pTargetChr->TakeDamage(vec2(0, 0), 0, m_Owner, m_Type);
if(pOwnerChar && !GameLayerClipped(ColPos) && if(pOwnerChar && !GameLayerClipped(ColPos) &&
((m_Type == WEAPON_GRENADE && pOwnerChar->HasTelegunGrenade()) || (m_Type == WEAPON_GUN && pOwnerChar->HasTelegunGun()))) ((m_Type == WEAPON_GRENADE && pOwnerChar->HasTelegunGrenade()) || (m_Type == WEAPON_GUN && pOwnerChar->HasTelegunGun())))