diff --git a/gen.go b/gen.go index c97b83a..851b589 100644 --- a/gen.go +++ b/gen.go @@ -12,7 +12,7 @@ import ( "os" ) -const version = "155" +const version = "158a" func main() { if err := run(); err != nil { diff --git a/libsteam_api.dylib b/libsteam_api.dylib index 41fc923..2d8957f 100644 Binary files a/libsteam_api.dylib and b/libsteam_api.dylib differ diff --git a/libsteam_api.so b/libsteam_api.so index 9476561..9798846 100644 Binary files a/libsteam_api.so and b/libsteam_api.so differ diff --git a/libsteam_api64.so b/libsteam_api64.so index d755843..85f66c6 100644 Binary files a/libsteam_api64.so and b/libsteam_api64.so differ diff --git a/steamworks.go b/steamworks.go index 8754334..e1ff861 100644 --- a/steamworks.go +++ b/steamworks.go @@ -87,6 +87,7 @@ type ISteamFriends interface { const ( flatAPI_RestartAppIfNecessary = "SteamAPI_RestartAppIfNecessary" flatAPI_Init = "SteamAPI_Init" + flatAPI_InitSafe = "SteamAPI_InitSafe" flatAPI_RunCallbacks = "SteamAPI_RunCallbacks" flatAPI_SteamApps = "SteamAPI_SteamApps_v008" diff --git a/steamworks_unix.go b/steamworks_unix.go index 3a1f8ef..8e37c77 100644 --- a/steamworks_unix.go +++ b/steamworks_unix.go @@ -241,9 +241,13 @@ func RestartAppIfNecessary(appID uint32) bool { } func Init() bool { - v, err := theLib.call(funcType_Bool, flatAPI_Init) + v, err := theLib.call(funcType_Bool, flatAPI_InitSafe) if err != nil { - panic(err) + // If InitSafe() doesn't work for some reason, fallback to Init() + v, err = theLib.call(funcType_Bool, flatAPI_Init) + if err != nil { + panic(err) + } } return byte(v) != 0 } diff --git a/steamworks_windows.go b/steamworks_windows.go index ff8f0f3..cd6c522 100644 --- a/steamworks_windows.go +++ b/steamworks_windows.go @@ -80,9 +80,13 @@ func RestartAppIfNecessary(appID uint32) bool { } func Init() bool { - v, err := theDLL.call(flatAPI_Init) + v, err := theDLL.call(flatAPI_InitSafe) if err != nil { - panic(err) + // If InitSafe() doesn't work for some reason, fallback to Init() + v, err = theDLL.call(flatAPI_Init) + if err != nil { + panic(err) + } } return byte(v) != 0 }