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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Instruction ret = ctor.Body.Instructions[ctor.Body.Instructions.Count - 1];
|
// remove the return opcode from end of function. will add our own later.
|
||||||
if (ret.OpCode == OpCodes.Ret)
|
if (!RemoveFinalRetInstruction(ctor))
|
||||||
{
|
|
||||||
ctor.Body.Instructions.RemoveAt(ctor.Body.Instructions.Count - 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Log.Error($"{netBehaviourSubclass.Name} has invalid constructor", ctor);
|
Log.Error($"{netBehaviourSubclass.Name} has invalid constructor", ctor);
|
||||||
WeavingFailed = true;
|
WeavingFailed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user