mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +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>
|
/// </summary>
|
||||||
public bool Trigger( string identifier, bool apply = true )
|
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 )
|
return a.Trigger( apply );
|
||||||
{
|
|
||||||
client.Stats.StoreStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -159,6 +155,9 @@ public Achievement( Client client, int index )
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Trigger( bool apply = true )
|
public bool Trigger( bool apply = true )
|
||||||
{
|
{
|
||||||
|
if ( State )
|
||||||
|
return false;
|
||||||
|
|
||||||
State = true;
|
State = true;
|
||||||
UnlockTime = DateTime.Now;
|
UnlockTime = DateTime.Now;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user