Fix: scattergun that has knockback cannot be fired on preround#1835
Fix: scattergun that has knockback cannot be fired on preround#1835M60TM wants to merge 2 commits intoValveSoftware:masterfrom
Conversation
|
I could be 100% wrong but isn't |
|
That check makes no sense regardless because the |
|
Wouldn't it still, in its current state, cause a crash if it doesn't contain a player? |
|
It will always contain a player, as this was already checked higher up in the call stack: source-sdk-2013/src/game/shared/tf/tf_weaponbase_gun.cpp Lines 94 to 97 in c623a7c |
|
Would it be better to replace |
- They reference same entity in-game
|
Maybe best to just change HasKnockback. Or else some other effects will possibly run in ApplyPostHitEffects and other places. |
|
The codes in FireBullet is intended to prevent movement via knockback before the round starts. Modifying the HasKnockback function could potentially introduce side effects in other parts of the code. |
|
Yes, modifying Also, it's probably important to note that these changes do not affect the entirety of setup time, only the short freeze time at the start where players cannot move. This check was likely added purely to prevent scouts from boosting themselves forward during that time, and disabling on-hit effects isn't necessary. |
Description
CTFScattergunwith theset_scattergun_has_knockbackattribute set to 1 cannot be fired because the code bypassesBaseClass::FireBullet. This PR fixes that behavior.