From 103842ca9750c3a000a79b4d119e5375f7ba1ff9 Mon Sep 17 00:00:00 2001 From: quasilyte Date: Sun, 13 Aug 2023 20:30:40 +0400 Subject: [PATCH] go-steamworks: fix SteamUserStats.GetAchievement on Windows (#5) This one is a sneaky one, since it's Windows-specific and it was impossible to debug on Linux why some players report all of their achievements being unlocked. Turns out, it's a Windows-specific typo in the library. --- steamworks_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamworks_windows.go b/steamworks_windows.go index 22ad5a6..ff8f0f3 100644 --- a/steamworks_windows.go +++ b/steamworks_windows.go @@ -288,7 +288,7 @@ func (s steamUserStats) GetAchievement(name string) (achieved, success bool) { cname := append([]byte(name), 0) defer runtime.KeepAlive(cname) - v, err := theDLL.call(flatAPI_ISteamUserStats_SetAchievement, uintptr(s), uintptr(unsafe.Pointer(&cname[0])), uintptr(unsafe.Pointer(&achieved))) + v, err := theDLL.call(flatAPI_ISteamUserStats_GetAchievement, uintptr(s), uintptr(unsafe.Pointer(&cname[0])), uintptr(unsafe.Pointer(&achieved))) if err != nil { panic(err) }