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

WEAPON:Clip1 and WEAPON:Clip2 not being networked to spectating players creates logic errors #6100

Open
T-Rizzle12 opened this issue Dec 4, 2024 · 0 comments
Labels
Net compat This issue requires breaking network compatibility to solve so it will be queued.

Comments

@T-Rizzle12
Copy link

Protocol version 24
Exe version 2024.10.29 (garrysmod)
Exe build: 19:13:34 Nov 28 2024 (9511) (4000)
GMod version 2024.11.28, branch: dev, multicore: 1
Windows 32bit

Details

It appears that Clip1() and Clip2() are not networked to other players. It's probably a networking optimization, but it creates issues when you are spectating someone. Some weapon addons either manually network both clips using NWVar's or others just accept the logic errors this creates. This issue occurs when the player reloads their weapons that use custom reload sequences such as shotguns. This issue also occurs to the default HL2 weapons that come with the game if they auto-reload when the primary clip is empty.

Steps to reproduce

  1. Enter a multiplayer server
  2. Spawn in a bot and make sure bot_zombie = 1 so it doesn't run away. Also, give the bot any ranged default HL2 weapon that uses clips
  3. Spectate the bot using lua_run Entity(1):Spectate( OBS_MODE_IN_EYE ) Entity(1):SpectateEntity( Entity(2) ) Entity(1):SetupHands( Entity(2) )
  4. You can check the amount of ammo in each clip using this for the server lua_run print( Entity(2):GetActiveWeapon():Clip1() ) and this for the client lua_run_cl print( Entity(2):GetActiveWeapon():Clip1() )
  5. Use bot_mimic to make the bot fire its weapon
  6. Check the ammo count on the server and client after making the bot fire a few shots
  7. Make the bot fire its entire clip and watch the reload animation be skipped, "See attached video"
  8. Repeat steps 4-6, but make the bot reload before it fires all of its ammo, the animation should play correctly when this happens for all weapons that use DefaultReload
    https://github.com/user-attachments/assets/f1d1bc81-3f58-43d6-83ae-4458151397f4
@robotboy655 robotboy655 added the Net compat This issue requires breaking network compatibility to solve so it will be queued. label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Net compat This issue requires breaking network compatibility to solve so it will be queued.
Projects
None yet
Development

No branches or pull requests

2 participants