Fix medigun prediction errors #21
Open
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.
All of the code which determines how much ubercharge you get on a specific tick was server only, causing the medigun to constantly cause prediction errors due to the client having no clue how much uber you were actually building, unless you are in a situation where you are getting the default ubercharge per tick (stock medigun, damaged patient, no critheals, etc.)
This fixes that by making all possible server code also be on the client. The only exception to this is an unused weapon attribute which would modify ubercharge rate as long as you weren't in a respawn room. The functions it calls are server only, and would require changes to how respawn room entities are handled on the client to fix. So any mods, server plugins, vscript, etc. that uses this plugin will still cause prediction errors
Due to being an unused attribute, and because it would require a change to something in a completely different part of the codebase, I decided that it was out of scope for this PR to fix that.
Related Issue
Source-1-Games Issue 4046
Implementation
Removed a
#ifdef GAME_DLLthat covered all of the ubercharge rate modification code, the ifdef was left for thePointInRespawnRoom()calls due to the function only being on the server.Screenshots
Checklist
tc2-modbranch.Testing Checklist
Caveats
The unused attribute "mult_uberchargerate_for_healer" (ubercharge rate bonus for healer) still will cause prediction errors due to relying on server code for func_respawnroom entities
Alternatives