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

Correct muzzle flash when server switches weapons #869

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AdamTadeusz
Copy link
Contributor

Description

Ideally the updateViewModelMuzzleFlash function should belong to the CNEOViewModelMuzzleFlash, but when doing it that way changing the muzzle flash skin doesn't seem to have an effect

Toolchain

  • Windows MSVC VS2022
  • Linux GCC Distro Native [Specify distro + GCC version]
  • Linux GCC 10 Sniper 3.0

Linked Issues

@AdamTadeusz
Copy link
Contributor Author

AdamTadeusz commented Feb 4, 2025

I should add that I avoided making these variables networked as I was worried they would generate traffic unnecessarily when a weapon is being fired. Having made them networked and observing generated traffic using dtwatchent entity id of muzzleflash I observed that these variables weren't being sent over the network, probably something clever decided its not necessary when the same function is ran both client and server side. However the scale of the muzzle flash would not update even though m_flModelScale is also a networked variable that exists both in a send and receive table.

This solution is the first one that I could find that fixed the whole problem in the fewest number of lines, if the reason why m_flModelScale was not being sent could be solved then making all these properties networked instead would be simpler.

Perhaps just updating the muzzle flash on this event would be even simpler, but then I ran into issues of the skin of the model (the 2 skin values switch between the circular and cross shape of the muzzle flash) not being updated correctly

@AdamTadeusz AdamTadeusz marked this pull request as draft February 4, 2025 20:37
@AdamTadeusz
Copy link
Contributor Author

I think ill work on this some more and get one of the two nicer looking methods working

… now networked, workaround for setmodelscale on server not changing model scale clientside
@AdamTadeusz AdamTadeusz marked this pull request as ready for review February 6, 2025 13:39
@AdamTadeusz AdamTadeusz requested a review from a team February 6, 2025 13:39
@AdamTadeusz AdamTadeusz marked this pull request as draft February 6, 2025 14:20
@AdamTadeusz
Copy link
Contributor Author

ok I think we can make this slightly better

@AdamTadeusz AdamTadeusz marked this pull request as ready for review February 6, 2025 14:40
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.

Weapon view model muzzle flash not updated when calling Weapon_Switch on the server
2 participants