hedgewars/hwengine.pas
changeset 2825 db7c35a0e9c1
parent 2803 1f446fc5c8ec
child 2905 f3c79f7193a9
--- a/hedgewars/hwengine.pas	Thu Feb 18 01:02:28 2010 +0000
+++ b/hedgewars/hwengine.pas	Thu Feb 18 13:23:24 2010 +0000
@@ -437,7 +437,6 @@
 	for i:=0 to ParamCount do
 		Write(ParamStr(i) + ' ');
 	WriteLn();
-	halt(1);
 end;
 
 ////////////////////
@@ -509,7 +508,7 @@
 						cFullScreen:= ParamStr(5) = '1';
 						cShowFPS:= ParamStr(6) = '1';
 					end
-					else DisplayUsage;
+					else GameType:= gmtSyntax;
 				end
 			end;
 		end;
@@ -531,7 +530,7 @@
 				cLocaleFName:= ParamStr(10);
 				cFullScreen:= ParamStr(11) = '1';
 			end
-			else DisplayUsage;
+			else GameType:= gmtSyntax;
 		end;
 		15: begin
 			PathPrefix:= ParamStr(1);
@@ -554,9 +553,9 @@
 				val(ParamStr(14), cTimerInterval);
 				cReducedQuality:= ParamStr(15) = '1';
 			end
-			else DisplayUsage;
+			else GameType:= gmtSyntax;
 		end;
-		else DisplayUsage;
+		else GameType:= gmtSyntax;
 	end;
 
 {$IFDEF DEBUGFILE}
@@ -580,8 +579,13 @@
 	Randomize();
 
 	if GameType = gmtLandPreview then GenLandPreview()
+	else if GameType = gmtSyntax then DisplayUsage()
 	else Game();
 	freeEverything();
-	ExitCode:= 0;
+	
+	if GameType = gmtSyntax then
+		ExitCode:= 1
+	else
+		ExitCode:= 0;
 {$ENDIF}
 end.