NetworkIdentity.GetNewObservers: result renamed to rebuildOverwritten because that's what it's for

This commit is contained in:
vis2k 2020-03-03 23:22:37 +01:00
parent 15a47ca19c
commit 6eedd2405c

View File

@ -973,17 +973,19 @@ internal void AddObserver(NetworkConnection conn)
// helper function to call OnRebuildObservers in all components // helper function to call OnRebuildObservers in all components
// -> HashSet is passed in so we can cache it! // -> HashSet is passed in so we can cache it!
// -> returns true if any of the components implemented
// OnRebuildObservers, false otherwise
internal bool GetNewObservers(HashSet<NetworkConnection> observersSet, bool initialize) internal bool GetNewObservers(HashSet<NetworkConnection> observersSet, bool initialize)
{ {
bool result = false; bool rebuildOverwritten = false;
observersSet.Clear(); observersSet.Clear();
foreach (NetworkBehaviour comp in NetworkBehaviours) foreach (NetworkBehaviour comp in NetworkBehaviours)
{ {
result |= comp.OnRebuildObservers(observersSet, initialize); rebuildOverwritten |= comp.OnRebuildObservers(observersSet, initialize);
} }
return result; return rebuildOverwritten;
} }
static readonly HashSet<NetworkConnection> newObservers = new HashSet<NetworkConnection>(); static readonly HashSet<NetworkConnection> newObservers = new HashSet<NetworkConnection>();