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

Weapons: Shotgun changes #1554

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

TW1STaL1CKY
Copy link
Contributor

  • Added SWEP.DryFireSound to the weapon base to allow the dryfire sound to be easily changed (now used by the shotgun)
  • Applied dryfire sound fix to the shotgun
  • Allowed the shotgun to attempt reloading on dryfire
  • Interrupting the shotgun's reload looks and feels less jank
  • Added a third person reload animation to the shotgun

Side note: while making these changes, I only now realised that the dryfire sound only plays for the player holding the weapon. I think this is fine but I thought I would ask, should we instead let the sound be audible to anyone near the player? I can make another PR if so

- Added SWEP.DryFireSound to the weapon base to allow the dryfire sound to be easily changed
- Applied dryfire fix to the shotgun
- Allowed the shotgun to attempt reloading on dryfire
- Interrupting the shotgun's reload looks and feels less jank
- Added a third person reload animation to the shotgun
@Racpy
Copy link
Contributor

Racpy commented Jun 12, 2024

This was a topic I was discussing shotgun reload animation on third person with others on the TTT2 Discord the other day, so I was excited to see this update!

personally, I think it's weird that the reload sound is only play on client, but I accept it.

@TimGoll
Copy link
Member

TimGoll commented Jun 12, 2024

Regarding the dry fire sound: how is it done for other weapons?

@TW1STaL1CKY
Copy link
Contributor Author

Regarding the dry fire sound: how is it done for other weapons?

A SWEP.DryFireSound field was added to weapon_tttbase and is referenced in SWEP:DryFire

Since the shotgun doesn't define its own SWEP:CanPrimaryAttack anymore, it'll use the default CanPrimaryAttack (which calls SWEP:DryFire) defined in the base. All the shotgun does now is set SWEP.DryFireSound to the shotgun empty wav path.
Any other weapon wanting to replace just the sound and nothing else can update that field.

Copy link
Member

@TimGoll TimGoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a moment to look through these changes and they look good to me. Especially that it now attempts to reload on dry fire. It always bothered me that shotguns were slightly different. Thanks a lot!

@TimGoll TimGoll added the type/enhancement Enhancement or simple change to existing functionality label Jun 13, 2024
@TimGoll TimGoll added this to the v0.14.0b milestone Jun 13, 2024
@TimGoll TimGoll merged commit afdfd91 into TTT-2:master Jun 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement or simple change to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants