Fix sending client RPC from host that is both server and client

This commit is contained in:
Wojciech Figat
2023-01-18 13:39:51 +01:00
parent 04727cf2bc
commit 689a042e88

View File

@@ -987,6 +987,7 @@ void NetworkInternal::NetworkReplicatorUpdate()
CachedWriteStream = New<NetworkStream>();
const bool isClient = NetworkManager::IsClient();
const bool isServer = NetworkManager::IsServer();
const bool isHost = NetworkManager::IsHost();
NetworkStream* stream = CachedWriteStream;
NetworkPeer* peer = NetworkManager::Peer;
@@ -1286,7 +1287,7 @@ void NetworkInternal::NetworkReplicatorUpdate()
// Client -> Server
peer->EndSendMessage(channel, msg);
}
else if (e.Info.Client && isServer)
else if (e.Info.Client && (isServer || isHost))
{
// Server -> Client(s)
BuildCachedTargets(item);