Fixed issue with Target SyncedVar when running as host

This commit is contained in:
Albin Corén 2018-04-18 20:03:33 +02:00
parent e8d58d292b
commit f45ac572ea

View File

@ -452,6 +452,8 @@ namespace MLAPI.MonoBehaviours.Core
} }
} }
else else
{
if (!(isHost && new NetId(ownerClientId).IsHost()))
{ {
//It's sync time. This is the target receivers packet. //It's sync time. This is the target receivers packet.
using (BitWriter writer = new BitWriter()) using (BitWriter writer = new BitWriter())
@ -536,6 +538,7 @@ namespace MLAPI.MonoBehaviours.Core
} }
InternalMessageHandler.Send(ownerClientId, "MLAPI_SYNC_VAR_UPDATE", "MLAPI_INTERNAL", writer.Finalize()); //Send only to target InternalMessageHandler.Send(ownerClientId, "MLAPI_SYNC_VAR_UPDATE", "MLAPI_INTERNAL", writer.Finalize()); //Send only to target
} }
}
if (nonTargetDirtyCount == 0) if (nonTargetDirtyCount == 0)
return; return;