[TF2] Fix being able to throw the Gas Passer through walls #1334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes ValveSoftware/Source-1-Games#3998
There's something about the Gas Passer's projectile model that makes it consistently pass through walls when thrown very close against them. Might be because the projectile is so much larger than the Jarate that it ends up spawning already inside the wall, but I'm not sure. Either way, this is easily fixed by doing a short trace to check if there's something solid immediately in front of the projectile when it's thrown, and forcing it to explode immediately if so.
This also kinda fixes throwing the Flying Guillotine through walls (which is not nearly as easy and consistent). The projectile will still travel through the wall, as no collision actually happened and it can't explode, but it will behave as if it did hit a wall, and won't hit any players on the other side.