From f343f0da41a1deb12633bd46c85c8d175de419cb Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:10:56 +0500 Subject: [PATCH] utils: mdldec: return different errorcodes on error. --- utils/mdldec/mdldec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/mdldec/mdldec.c b/utils/mdldec/mdldec.c index 58c69241..576728b5 100644 --- a/utils/mdldec/mdldec.c +++ b/utils/mdldec/mdldec.c @@ -266,6 +266,8 @@ static void ShowHelp( const char *app_name ) int main( int argc, char *argv[] ) { + int ret = 0; + puts( "\nHalf-Life Studio Model Decompiler " APP_VERSION ); puts( "Copyright Flying With Gauss 2020 (c) " ); puts( "--------------------------------------------------" ); @@ -273,6 +275,7 @@ int main( int argc, char *argv[] ) if( argc == 1 ) { ShowHelp( argv[0] ); + ret = 2; goto end; } else if( argc == 3 ) @@ -280,6 +283,7 @@ int main( int argc, char *argv[] ) if( Q_strlen( argv[2] ) > MAX_SYSPATH - 2 ) { fputs( "ERROR: Destination path is too long.\n", stderr ); + ret = 1; goto end; } @@ -287,7 +291,10 @@ int main( int argc, char *argv[] ) } if( !LoadActivityList( argv[0] ) || !LoadMDL( argv[1] ) ) + { + ret = 1; goto end; + } WriteQCScript(); WriteSMD(); @@ -298,6 +305,6 @@ int main( int argc, char *argv[] ) end: puts( "--------------------------------------------------" ); - return 0; + return ret; }