mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-05 02:00:45 +03:00
Fallback to FindOrCreateUserInterface if CreateInterface returns null
This commit is contained in:
parent
a2942bd098
commit
98915f0950
@ -47,12 +47,18 @@ namespace Steamworks
|
||||
// CreateInterface doesn't seem to have caused any fires, so we'll just use that.
|
||||
//
|
||||
|
||||
// var user = SteamAPI.GetHSteamUser();
|
||||
//
|
||||
// var pipe = SteamAPI.GetHSteamPipe();
|
||||
// Self = SteamInternal.FindOrCreateUserInterface( user, InterfaceName );
|
||||
//
|
||||
|
||||
Self = SteamInternal.CreateInterface( InterfaceName );
|
||||
|
||||
if ( Self == IntPtr.Zero )
|
||||
{
|
||||
var user = SteamAPI.GetHSteamUser();
|
||||
Self = SteamInternal.FindOrCreateUserInterface( user, InterfaceName );
|
||||
}
|
||||
|
||||
if ( Self == IntPtr.Zero )
|
||||
throw new System.Exception( $"Couldn't find interface {InterfaceName}" );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user