From 9ad3a57ad9ba152de9ac346a67c98e6b86783e97 Mon Sep 17 00:00:00 2001 From: Andrii Vitiv <37713088+TheCubicNoobik@users.noreply.github.com> Date: Sun, 15 Sep 2019 00:48:49 +0300 Subject: [PATCH] Fix SteamFriends.GetRichPresence(key, value) Adds key/value to the dictionary only if the rich presence was set successfully. Also fixes #307 --- Facepunch.Steamworks/SteamFriends.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index 5acefbb..dda0fcf 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -253,8 +253,12 @@ public static string GetRichPresence( string key ) /// public static bool SetRichPresence( string key, string value ) { - richPresence[key] = value; - return Internal.SetRichPresence( key, value ); + bool success = Internal.SetRichPresence( key, value ); + + if ( success ) + richPresence[key] = value; + + return success; } /// @@ -285,4 +289,4 @@ public static bool ListenForFriendsMessages } } -} \ No newline at end of file +}