This commit is contained in:
Paul Pacheco 2020-09-22 13:03:33 -05:00
parent c868561822
commit 25b2fa9af8

View File

@ -33,24 +33,13 @@ static void ProcessMethods(TypeDefinition td)
// find command and RPC functions
foreach (MethodDefinition md in td.Methods)
{
foreach (CustomAttribute ca in md.CustomAttributes)
{
if (ca.AttributeType.Is<CommandAttribute>())
{
if (md.HasCustomAttribute<CommandAttribute>())
Weaver.Error($"Command {md.Name} must be declared inside a NetworkBehaviour", md);
}
if (ca.AttributeType.Is<ClientRpcAttribute>())
{
if (md.HasCustomAttribute<ClientRpcAttribute>())
Weaver.Error($"ClientRpc {md.Name} must be declared inside a NetworkBehaviour", md);
}
if (ca.AttributeType.Is<TargetRpcAttribute>())
{
if (md.HasCustomAttribute<TargetRpcAttribute>())
Weaver.Error($"TargetRpc {md.Name} must be declared inside a NetworkBehaviour", md);
}
}
}
}
}
}