mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
adding static check before adding this arg (#1668)
This commit is contained in:
parent
60678d9bc7
commit
7a06815d75
@ -216,7 +216,11 @@ public static MethodDefinition ProcessSyncVarSet(TypeDefinition td, FieldDefinit
|
||||
setWorker.Append(setWorker.Create(OpCodes.Call, Weaver.setSyncVarHookGuard));
|
||||
|
||||
// call hook (oldValue, newValue)
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
// dont add this (Ldarg_0) if method is static
|
||||
if (!hookFunctionMethod.IsStatic)
|
||||
{
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_0));
|
||||
}
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldloc, oldValue));
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldarg_1));
|
||||
setWorker.Append(setWorker.Create(OpCodes.Callvirt, hookFunctionMethod));
|
||||
|
Loading…
Reference in New Issue
Block a user