hedgewars/hwengine.pas
changeset 8174 df02c2ad4a2c
parent 8170 b0abfa1a4d4a
child 8209 780e156f19ea
--- a/hedgewars/hwengine.pas	Sat Dec 01 15:14:34 2012 -0500
+++ b/hedgewars/hwengine.pas	Sat Dec 01 15:56:19 2012 -0500
@@ -545,16 +545,20 @@
     tmpInt: LongInt;
 begin
     if (ParamCount < 2) then
+        begin
         DisplayUsage();
         GameType:= gmtSyntax
+        end
     else
         if (ParamCount >= 2) then
             begin
             UserPathPrefix:= ParamStr(1);
             PathPrefix:= ParamStr(2)
             end;
+
         if (ParamCount >= 3) then
             recordFileName:= ParamStr(3);
+
         if (ParamCount = 2) or
            ((ParamCount >= 3) and (Copy(recordFileName,1,2) = '--')) then
             begin
@@ -565,27 +569,24 @@
             end
         else
             startIndex := 4;
+
         if (ParamCount = startIndex) and 
            (ParamStr(startIndex) = 'landpreview') then
             begin
             ipcPort:= StrToInt(ParamStr(2));
             GameType:= gmtLandPreview;
             end
+        else if (ParamCount = startIndex) and 
+                (ParamStr(startIndex) = '--stats-only') then
+            playReplayFileWithParameters(startIndex)
+        else if ParamCount = cDefaultParamNum then
+            internalStartGameWithParameters()
+{$IFDEF USE_VIDEO_RECORDING}
+        else if ParamCount = cVideorecParamNum then
+            internalStartVideoRecordingWithParameters()
+{$ENDIF}
         else
-            begin
-            if (ParamCount = startIndex) and 
-               (ParamStr(startIndex) = '--stats-only') then
-                playReplayFileWithParameters(startIndex)
-            else
-                if ParamCount = cDefaultParamNum then
-                    internalStartGameWithParameters()
-{$IFDEF USE_VIDEO_RECORDING}
-                else if ParamCount = cVideorecParamNum then
-                    internalStartVideoRecordingWithParameters()
-{$ENDIF}
-                else
-                    playReplayFileWithParameters(startIndex);
-            end
+            playReplayFileWithParameters(startIndex)
 end;
 
 ///////////////////////////////////////////////////////////////////////////////