hedgewars/ArgParsers.inc
changeset 5130 3602ede67ec5
parent 4976 088d40d8aba2
child 5238 46ddaf14509d
--- a/hedgewars/ArgParsers.inc	Sat Apr 09 15:54:28 2011 -0400
+++ b/hedgewars/ArgParsers.inc	Sun Apr 10 20:24:25 2011 +0400
@@ -16,12 +16,19 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
+procedure playReplayFileWithParameters(); forward;
+
 procedure internalSetGameTypeLandPreviewFromParameters();
 begin
-    val(ParamStr(2), ipcPort);
-    GameType:= gmtLandPreview;
-    if ParamStr(3) <> 'landpreview' then
-        GameType:= gmtSyntax
+    if ParamStr(3) = '--stats-only' then
+        playReplayFileWithParameters()
+    else
+        begin
+        val(ParamStr(2), ipcPort);
+        GameType:= gmtLandPreview;
+        if ParamStr(3) <> 'landpreview' then
+            GameType:= gmtSyntax
+        end
 end;
 
 procedure internalStartGameWithParameters();
@@ -210,10 +217,19 @@
                             paramIndex:= paramIndex + 13
                             end
                         else
-                            begin
-                            wrongParameter:= true;
-                            GameType:= gmtSyntax
-                            end
+                            if ParamStr(paramIndex) = '--stats-only'  then
+                                begin
+                                cOnlyStats:= true;
+                                isSoundEnabled:= false;
+                                isMusicEnabled:= false;
+                                cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK
+                                paramIndex:= paramIndex + 1
+                                end
+                            else
+                                begin
+                                wrongParameter:= true;
+                                GameType:= gmtSyntax
+                                end
     end
 end;