-
Notifications
You must be signed in to change notification settings - Fork 455
fix: OnValueChanged not being triggered on collections when the collection changes back to the previous value #3539
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
fix: OnValueChanged not being triggered on collections when the collection changes back to the previous value #3539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch and fix!
…/com.unity.netcode.gameobjects into fix/collection-authority-onvaluechanged
// lowest risk approach to resolving the issue where a client with no write permissions could make changes to a collection locally | ||
// which can cause a myriad of issues. | ||
private protected T m_InternalOriginalValue; | ||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
https://jira.unity3d.com/browse/MTTB-1421 fixes: #3534 ## Changelog - Fixed: When calling `CheckDirtyState(true)` on a `NetworkVariable` collection, `OnValueChanged` now triggers on the authority if the authority has changed the collection and then changed it back to the initial state in the same frame. This matches the behaviour of non-collection NetworkVariables. ## Testing and Documentation - Includes unit tests. - Includes integration tests. ## Backport This is a backport of #3539
https://jira.unity3d.com/browse/MTTB-1421
fixes: #3534
Changelog
CheckDirtyState(true)
on aNetworkVariable
collection,OnValueChanged
now triggers on the authority if the authority has changed the collection and then changed it back to the initial state in the same frame. This matches the behaviour of non-collection NetworkVariables.Testing and Documentation
Backport
Backported by #3544