This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
Fix Set Kinematic When Not Authoritative
not being applied correctly.
#1456
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.
Description
We had two different bugs that revealed themselves when we removed the
AuthorityLossImminent
state in #1451SetKinematicFromAuthoritySystem
was grabbing the first authority change received in that frame to use as the authority change. In the case where you gotAuthorityLossImminent
and thenNotAuthoritative
in the same frame, it would grabAuthorityLossImminent
(incorrectly).ConstructEntityQueryDesc<T>
would have anExclude<TransformInternal.HasAuthority>
filter on it. This meant that we would never even attempt to reset the kinematic authority set when you become 'not authoritative'.These two bugs combined meant that the kinematic state would never be by the system ever. In the playground, this seemed not to matter so we never noticed it (and the fact that we typically would only ever run with 1 worker locally).
When we removed the
AuthorityLossImminent
state, the first bug ceased to apply meaning that we just ended up with weird behaviour with multiple GameLogic workers.This PR fixes both these bugs, the first by grabbing the correct element from the authority changes span and the second by making
ConstructEntityQueryDesc
take a tri-state enum of either (Exclude, Ignore, or Required).Remaining work
Tests
Is Kinematic
state was being set.