--- 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;
///////////////////////////////////////////////////////////////////////////////