NetworkBehaviour.InvokeSyncEventDelegate simplified

This commit is contained in:
vis2k 2018-12-30 17:30:43 +01:00
parent 3d7a10fd08
commit 98f984182a

View File

@ -322,20 +322,15 @@ internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
{
if (!s_CmdHandlerDelegates.ContainsKey(cmdHash))
Invoker invoker;
if (s_CmdHandlerDelegates.TryGetValue(cmdHash, out invoker) &&
invoker.invokeType == UNetInvokeType.SyncEvent)
{
return false;
}
Invoker inv = s_CmdHandlerDelegates[cmdHash];
if (inv.invokeType != UNetInvokeType.SyncEvent)
{
return false;
}
inv.invokeFunction(this, reader);
invoker.invokeFunction(this, reader);
return true;
}
return false;
}
internal static string GetCmdHashHandlerName(int cmdHash)
{