mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Don't StoreStats achievement on trigger if already unlocked
This commit is contained in:
parent
1c04459cdb
commit
a26ae696c2
@ -50,14 +50,10 @@ public Achievement Find( string identifier )
|
||||
/// </summary>
|
||||
public bool Trigger( string identifier, bool apply = true )
|
||||
{
|
||||
var r = client.native.userstats.SetAchievement( identifier );
|
||||
var a = Find( identifier );
|
||||
if ( a == null ) return false;
|
||||
|
||||
if ( apply )
|
||||
{
|
||||
client.Stats.StoreStats();
|
||||
}
|
||||
|
||||
return r;
|
||||
return a.Trigger( apply );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -159,6 +155,9 @@ public Achievement( Client client, int index )
|
||||
/// </summary>
|
||||
public bool Trigger( bool apply = true )
|
||||
{
|
||||
if ( State )
|
||||
return false;
|
||||
|
||||
State = true;
|
||||
UnlockTime = DateTime.Now;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user