Fix crash in object id reference replication

This commit is contained in:
Wojciech Figat
2022-10-19 11:35:50 +02:00
parent 7621252f46
commit a5a39ac3d6

View File

@@ -625,7 +625,9 @@ namespace Flax.Build.Plugins
il.Emit(OpCodes.Stloc_0);
il.Emit(OpCodes.Ldarg_0);
var varStart = il.Body.Variables.Count;
il.Body.Variables.Add(new VariableDefinition(module.ImportReference(guidType)));
var reference = module.ImportReference(guidType);
reference.IsValueType = true; // Fix locals init to have valuetype for Guid instead of class
il.Body.Variables.Add(new VariableDefinition(reference));
il.Body.InitLocals = true;
il.Emit(OpCodes.Ldloca_S, (byte)varStart);
il.Emit(OpCodes.Ldtoken, valueType);