mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
refactor: Load parameters right before function call
This commit is contained in:
parent
ff909bf830
commit
8c93f31b80
@ -110,19 +110,6 @@ public static MethodDefinition ProcessSyncVarSet(TypeDefinition td, FieldDefinit
|
||||
|
||||
ILProcessor setWorker = set.Body.GetILProcessor();
|
||||
|
||||
// this
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
|
||||
// new value to set
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_1));
|
||||
|
||||
// reference to field to set
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldflda, fd));
|
||||
|
||||
// dirty bit
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldc_I8, dirtyBit)); // 8 byte integer aka long
|
||||
|
||||
MethodDefinition hookFunctionMethod;
|
||||
CheckForHookFunction(td, fd, out hookFunctionMethod);
|
||||
|
||||
@ -154,6 +141,20 @@ public static MethodDefinition ProcessSyncVarSet(TypeDefinition td, FieldDefinit
|
||||
setWorker.Append(label);
|
||||
}
|
||||
|
||||
// this
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
|
||||
// new value to set
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_1));
|
||||
|
||||
// reference to field to set
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldflda, fd));
|
||||
|
||||
// dirty bit
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldc_I8, dirtyBit)); // 8 byte integer aka long
|
||||
|
||||
|
||||
if (fd.FieldType.FullName == Weaver.gameObjectType.FullName)
|
||||
{
|
||||
// reference to netId Field to set
|
||||
|
Loading…
Reference in New Issue
Block a user