From 18262fd4f244eeafcb8a6e74247d49a5186e61b3 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 11 Apr 2019 16:39:59 +0100 Subject: [PATCH] Fixed early outing with enum for no reason --- .../SteamNative/SteamNative.SteamGameSearch.cs | 1 - Generator/CodeWriter/Class.cs | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameSearch.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameSearch.cs index 61df010..cf63fa9 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameSearch.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameSearch.cs @@ -98,7 +98,6 @@ public GameSearchErrorCode_t RetrieveConnectionDetails( CSteamID steamIDHost /*c System.Text.StringBuilder pchConnectionDetails_sb = Helpers.TakeStringBuilder(); int cubConnectionDetails = 4096; bSuccess = platform.ISteamGameSearch_RetrieveConnectionDetails( steamIDHost.Value, pchConnectionDetails_sb, cubConnectionDetails ); - if ( !bSuccess ) return bSuccess; pchConnectionDetails = pchConnectionDetails_sb.ToString(); return bSuccess; } diff --git a/Generator/CodeWriter/Class.cs b/Generator/CodeWriter/Class.cs index 72bd08e..6616268 100644 --- a/Generator/CodeWriter/Class.cs +++ b/Generator/CodeWriter/Class.cs @@ -349,8 +349,9 @@ private void Detect_StringFetch( List argList, List callargs var num = argList[i+1]; var IntReturn = ReturnType.Contains( "int" ); + var intReturn = ReturnType.Contains( "int" ); - if ( num.ManagedType.Trim( '*' ) != "int" && num.ManagedType.Trim( '*' ) != "uint" ) continue; + if ( num.ManagedType.Trim( '*' ) != "int" && num.ManagedType.Trim( '*' ) != "uint" ) continue; argList.Remove( num ); @@ -382,8 +383,11 @@ private void Detect_StringFetch( List argList, List callargs if ( ReturnString ) AfterLines.Insert( 0, $"return {chr.Name}_sb.ToString();" ); else AfterLines.Insert( 0, $"{chr.Name} = {chr.Name}_sb.ToString();" ); - - if ( IntReturn ) + if ( enumReturn ) + { + // Fuck all + } + else if ( intReturn ) { if ( ReturnString ) AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return null;" ); else AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return bSuccess;" );