Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Cleared field bugfix of #1211 #1229

Merged
merged 5 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- It will now wait for at least 1 second to elapse after the last change before writing the configuration back to disk.
- Fixed issues ([#957](https://github.com/spatialos/gdk-for-unity/issues/957), [#958](https://github.com/spatialos/gdk-for-unity/issues/958)) where valid schema would generate invalid code due to name clashes. [#1222](https://github.com/spatialos/gdk-for-unity/pull/1222)
- The offending schema properties will no longer be generated and are now logged in the Unity Editor.
- Fixed a bug where cleared fields in a received update would not be applied to the diff. [#1229](https://github.com/spatialos/gdk-for-unity/pull/1229)

### Internal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace <#= qualifiedNamespace #>

public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
{
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() > 0)
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() + op.Update.SchemaData.Value.GetClearedFieldCount() > 0)
{
var update = <#= componentNamespace #>.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);
diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
Expand Down