From ae900f84bc5474f1ca2618058ca4c7d9ebeb6f54 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 24 Feb 2020 12:00:42 +0000 Subject: [PATCH] Added Friend.GetAchievement --- Facepunch.Steamworks/Structs/Friend.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Facepunch.Steamworks/Structs/Friend.cs b/Facepunch.Steamworks/Structs/Friend.cs index a6802dc..9110212 100644 --- a/Facepunch.Steamworks/Structs/Friend.cs +++ b/Facepunch.Steamworks/Structs/Friend.cs @@ -227,5 +227,21 @@ namespace Steamworks return val; } + /// + /// Gets a user achievement state. Must call RequestUserStats first. + /// + /// The name of the achievement you want to get + /// Will return this value if not available + /// The value, or defult if not available + public bool GetAchievement( string statName, bool defult = false ) + { + var val = defult; + + if ( !SteamUserStats.Internal.GetUserAchievement( Id, statName, ref val ) ) + return defult; + + return val; + } + } } \ No newline at end of file