Skip to content

Commit

Permalink
fix: MirrorNetworking#3340 SyncSet/Dictionary callbacks are only call…
Browse files Browse the repository at this point in the history
…ed once
  • Loading branch information
vis2k committed Jan 5, 2023
1 parent c5aa474 commit 7b7ad85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions Assets/Mirror/Core/SyncDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,9 @@ public override void OnDeserializeDelta(NetworkReader reader)
break;
}

if (apply)
{
Callback?.Invoke(operation, key, item);
}
// we just skipped this change
else
if (!apply)
{
// we just skipped this change
changesAhead--;
}
}
Expand Down
1 change: 0 additions & 1 deletion Assets/Mirror/Core/SyncList.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Mirror
{
Expand Down
8 changes: 2 additions & 6 deletions Assets/Mirror/Core/SyncSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,9 @@ public override void OnDeserializeDelta(NetworkReader reader)
break;
}

if (apply)
{
Callback?.Invoke(operation, item);
}
// we just skipped this change
else
if (!apply)
{
// we just skipped this change
changesAhead--;
}
}
Expand Down

0 comments on commit 7b7ad85

Please sign in to comment.