mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Weaver: NetworkBehaviourProcessor.GenerateConstants: reuse RemoveFinalRetInstruction
This commit is contained in:
parent
073c87e8d1
commit
280756e0a2
@ -294,12 +294,8 @@ void GenerateConstants(ref bool WeavingFailed)
|
||||
return;
|
||||
}
|
||||
|
||||
Instruction ret = ctor.Body.Instructions[ctor.Body.Instructions.Count - 1];
|
||||
if (ret.OpCode == OpCodes.Ret)
|
||||
{
|
||||
ctor.Body.Instructions.RemoveAt(ctor.Body.Instructions.Count - 1);
|
||||
}
|
||||
else
|
||||
// remove the return opcode from end of function. will add our own later.
|
||||
if (!RemoveFinalRetInstruction(ctor))
|
||||
{
|
||||
Log.Error($"{netBehaviourSubclass.Name} has invalid constructor", ctor);
|
||||
WeavingFailed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user