Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ApplyMultiDamage duplicated call on MultiDamage routine #946

Merged
merged 1 commit into from
May 8, 2024

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented Feb 13, 2024

This seems redundant but avoids an API call from ApplyMultiDamage at the first AddMultiDamage call since there's no pEntity, forcing a call to this function without success. This expects to straighten subplugin's hooks to work as expected since ApplyMultiDamage should be called at the end of the MultiDamage routine, or when other entity is hit (penetration or shotgun spread).

In case of a weapon with no penetration (usp, for example) a simple FireBullets3 call will result in:

  • ClearMultiDamage (null pEntity)
  • TraceAttack pre (null pEntity)
    • AddMultiDamage pre (null pEntity)
      • ApplyMultiDamage (null pEntity -> no TakeDamage call inside)
      • pEntity assigned to a valid entity
    • AddMultiDamage post (valid pEntity)
  • TraceAttack post (valid pEntity)
  • ApplyMultiDamage (valid pEntity -> TakeDamage call)

@s1lentq s1lentq merged commit 4ecf427 into rehlds:master May 8, 2024
4 checks passed
@dystopm dystopm deleted the applymultidamage-fix branch August 13, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants