Skip to content

[TF2] Allow set_scattergun_has_knockback attribute to take on values greater than 1#772

Open
FlaminSarge wants to merge 1 commit into
ValveSoftware:masterfrom
FlaminSarge:scattergun-jump
Open

[TF2] Allow set_scattergun_has_knockback attribute to take on values greater than 1#772
FlaminSarge wants to merge 1 commit into
ValveSoftware:masterfrom
FlaminSarge:scattergun-jump

Conversation

@FlaminSarge
Copy link
Copy Markdown
Contributor

@FlaminSarge FlaminSarge commented Feb 24, 2025

This increases the number of times self-knockback may be applied via the attribute.
This also changes m_bScattergunJump to m_iScattergunJump and updates any relevant code accordingly.

Changes CTFPlayerShared's bool m_bScattergunJump to int m_iScattergunJump.
Renames CTFScattergun's HasKnockback to GetKnockbackCount to return the attribute value directly.
Changes all usages of HasKnockback to GetKnockbackCount() > 0
Changes CTFScatterGun's FireBullet knockback logic to compare the value of m_iScattergunJump to GetKnockbackCount in order to determine whether to apply self-knockback.
Changes CanScatterGunKnockBack in tf_weapon_shotgun to be consistent with elsewhere on > 0 check, fixing an issue where values of -1 could cause the regular-damage-zero-z-force behavior but not actually apply the extra knockback.

This version of the PR includes #682 for easy rebasing/inclusion in projects that already include that PR.
Rebased onto master now that the above PR is included in master.

Should be demo-safe.

Implements mastercomfig/tf2-patches-old#462

@FlaminSarge FlaminSarge changed the title Allow set_scattergun_has_knockback attribute to take on values greater than 1 [TF2] Allow set_scattergun_has_knockback attribute to take on values greater than 1 Feb 24, 2025
@FlaminSarge
Copy link
Copy Markdown
Contributor Author

@wgetJane let me know if I missed anything/messed up on this

@wgetJane
Copy link
Copy Markdown
Contributor

looks good

…r than 1

Also fixes issue where values of -1 could prevent regular downwards damage force while not providing the attribute knockback
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