diff --git a/Assets/Mirror/Editor/Weaver/Writers.cs b/Assets/Mirror/Editor/Weaver/Writers.cs index 6458bbfcc..aefb36e28 100644 --- a/Assets/Mirror/Editor/Weaver/Writers.cs +++ b/Assets/Mirror/Editor/Weaver/Writers.cs @@ -373,7 +373,7 @@ static MethodDefinition GenerateListWriteFunc(TypeReference variable) // int length writerFunc.Body.Variables.Add(new VariableDefinition(WeaverTypes.Import())); - // int i; + // int i writerFunc.Body.Variables.Add(new VariableDefinition(WeaverTypes.Import())); ILProcessor worker = writerFunc.Body.GetILProcessor(); @@ -388,7 +388,7 @@ static MethodDefinition GenerateListWriteFunc(TypeReference variable) worker.Append(worker.Create(OpCodes.Stloc_0)); // writer.WritePackedInt32(count); - // for (int i=0; i < count; i++) + // for (int i=0; i < length; i++) GenerateFor(worker, () => { MethodReference getItem = WeaverTypes.ListGetItemReference.MakeHostInstanceGeneric(genericInstance); @@ -416,7 +416,7 @@ private static void GenerateFor(ILProcessor worker, Action body) // Loop through the List and call the writer for each element. // generates this: - // for (int i=0; i < count; i++) + // for (int i=0; i < length; i++) // { // writer.WriteT(value[i]); // } @@ -439,7 +439,7 @@ private static void GenerateFor(ILProcessor worker, Action body) worker.Append(worker.Create(OpCodes.Stloc_1)); worker.Append(labelHead); - // for loop i < count + // for loop i < length worker.Append(worker.Create(OpCodes.Ldloc_1)); worker.Append(worker.Create(OpCodes.Ldloc_0)); worker.Append(worker.Create(OpCodes.Blt, labelBody));