Fixed early outing with enum for no reason

This commit is contained in:
Garry Newman 2019-04-11 16:39:59 +01:00
parent 1e1eb00e04
commit 18262fd4f2
2 changed files with 7 additions and 4 deletions

View File

@ -98,7 +98,6 @@ public GameSearchErrorCode_t RetrieveConnectionDetails( CSteamID steamIDHost /*c
System.Text.StringBuilder pchConnectionDetails_sb = Helpers.TakeStringBuilder(); System.Text.StringBuilder pchConnectionDetails_sb = Helpers.TakeStringBuilder();
int cubConnectionDetails = 4096; int cubConnectionDetails = 4096;
bSuccess = platform.ISteamGameSearch_RetrieveConnectionDetails( steamIDHost.Value, pchConnectionDetails_sb, cubConnectionDetails ); bSuccess = platform.ISteamGameSearch_RetrieveConnectionDetails( steamIDHost.Value, pchConnectionDetails_sb, cubConnectionDetails );
if ( !bSuccess ) return bSuccess;
pchConnectionDetails = pchConnectionDetails_sb.ToString(); pchConnectionDetails = pchConnectionDetails_sb.ToString();
return bSuccess; return bSuccess;
} }

View File

@ -349,8 +349,9 @@ private void Detect_StringFetch( List<Argument> argList, List<Argument> callargs
var num = argList[i+1]; var num = argList[i+1];
var IntReturn = ReturnType.Contains( "int" ); 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 ); argList.Remove( num );
@ -382,8 +383,11 @@ private void Detect_StringFetch( List<Argument> argList, List<Argument> callargs
if ( ReturnString ) AfterLines.Insert( 0, $"return {chr.Name}_sb.ToString();" ); if ( ReturnString ) AfterLines.Insert( 0, $"return {chr.Name}_sb.ToString();" );
else AfterLines.Insert( 0, $"{chr.Name} = {chr.Name}_sb.ToString();" ); else AfterLines.Insert( 0, $"{chr.Name} = {chr.Name}_sb.ToString();" );
if ( enumReturn )
if ( IntReturn ) {
// Fuck all
}
else if ( intReturn )
{ {
if ( ReturnString ) AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return null;" ); if ( ReturnString ) AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return null;" );
else AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return bSuccess;" ); else AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return bSuccess;" );