mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
parent
c8a0ddb6d3
commit
7d905626ae
@ -643,14 +643,8 @@ static MethodDefinition GenerateReadFunction(TypeReference variable)
|
||||
continue;
|
||||
|
||||
// mismatched ldloca/ldloc for struct/class combinations is invalid IL, which causes crash at runtime
|
||||
if (variable.IsValueType)
|
||||
{
|
||||
worker.Append(worker.Create(OpCodes.Ldloca, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
worker.Append(worker.Create(OpCodes.Ldloc, 0));
|
||||
}
|
||||
OpCode opcode = variable.IsValueType ? OpCodes.Ldloca : OpCodes.Ldloc;
|
||||
worker.Append(worker.Create(opcode, 0));
|
||||
|
||||
var readFunc = GetReadFunc(field.FieldType);
|
||||
if (readFunc != null)
|
||||
|
Loading…
Reference in New Issue
Block a user