legoandmars / BiggerLobby

Functional version of kermeet's biglobby mod.
MIT License
15 stars 4 forks source link

Add clamp to "volume" #6

Closed ege-adam closed 11 months ago

ege-adam commented 11 months ago

Hello, thank you for creating/maintaining BiggerLobby!

The BiggerLobby tries to set volume above 1f sometimes. Which causes an error and prevents "UpdatePlayerVoiceEffects" run properly. Which also prevents my mod (MoreScreams) to run properly too. I've clamped it.

For reference, here a part from my log without this patch:

[Error  : Unity Log] ArgumentOutOfRangeException: Volume must be between 0 and 1
Parameter name: value
Stack trace:
Dissonance.RemoteVoicePlayerState.set_Volume (System.Single value) (at <e92564caf0834e68898e38932a2c2ea2>:0)
MoreScreams.Patches.UpdatePlayerVoiceEffectsPatch.Postfix () (at <61dc102499a6435e91744621e1495ab9>:0)
(wrapper dynamic-method) StartOfRound.DMD<StartOfRound::UpdatePlayerVoiceEffects>(StartOfRound)
GameNetcodeStuff.PlayerControllerB.KillPlayerClientRpc (System.Int32 playerId, System.Boolean spawnBody, UnityEngine.Vector3 bodyVelocity, System.Int32 causeOfDeath, System.Int32 deathAnimation) (at <39ddadb2aa5843e586a6c642ee60b0b5>:0)
GameNetcodeStuff.PlayerControllerB.__rpc_handler_168339603 (Unity.Netcode.NetworkBehaviour target, Unity.Netcode.FastBufferReader reader, Unity.Netcode.__RpcParams rpcParams) (at <39ddadb2aa5843e586a6c642ee60b0b5>:0)
Unity.Netcode.RpcMessageHelpers.Handle (Unity.Netcode.NetworkContext& context, Unity.Netcode.RpcMetadata& metadata, Unity.Netcode.FastBufferReader& payload, Unity.Netcode.__RpcParams& rpcParams) (at <1b23ec5fcbfc4fbca0db70afcdb9b715>:0)
Rethrow as Exception: Unhandled RPC exception!
UnityEngine.Debug:LogException(Exception)
Unity.Netcode.RpcMessageHelpers:Handle(NetworkContext&, RpcMetadata&, FastBufferReader&, __RpcParams&)
Unity.Netcode.ClientRpcMessage:Handle(NetworkContext&)
Unity.Netcode.NetworkMessageManager:ReceiveMessage(FastBufferReader, NetworkContext&, NetworkMessageManager)
Unity.Netcode.NetworkMessageManager:HandleMessage(NetworkMessageHeader&, FastBufferReader, UInt64, Single, Int32)
Unity.Netcode.NetworkMessageManager:ProcessIncomingMessageQueue()
Unity.Netcode.NetworkManager:NetworkUpdate(NetworkUpdateStage)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage(NetworkUpdateStage)
Unity.Netcode.<>c:<CreateLoopSystem>b__0_0()
legoandmars commented 11 months ago

appreciate the fix