Skip to content

Commit 6ea5f52

Browse files
cleaner and friendlier comment
1 parent 8a411ae commit 6ea5f52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

com.unity.multiplayer.mlapi/Runtime/Core/NetworkedBehaviour.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@ internal void InitializeVars()
338338
for (int i = 0; i < networkedVarFields.Count; i++)
339339
{
340340
// this could be cleaner. The GetChannel() methods look for the SendChannel string channel name
341-
// from the settings file.
342-
string channelName = networkedVarFields[i].GetChannel(); // Cache this here. Some developers are stupid. You don't know what shit they will do in their methods
341+
// from the settings file, which could be easily misconfigured. If a bogus channel is specified,
342+
// GetChannelByte() will return the default, MLAPI_INTERNAL_CHANNEL
343+
string channelName = networkedVarFields[i].GetChannel();
343344
byte channel = Transport.GetChannelByte(channelName);
344345

345346
if (!firstLevelIndex.ContainsKey(channel))

0 commit comments

Comments
 (0)