Merge pull request #8856 from ChillerDragon/pr_gun_damage

Call TakeDamage on projectile and laser hit (gun, shotgun and laser)
This commit is contained in:
Dennis Felsing 2024-08-31 21:35:16 +00:00 committed by GitHub
commit 871f97a283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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())))