hedgewars/hwengine.pas
changeset 9988 317d46a2afd2
parent 9651 c0a389ccb0c1
child 9998 736015b847e3
--- a/hedgewars/hwengine.pas	Tue Jan 14 11:45:52 2014 +0100
+++ b/hedgewars/hwengine.pas	Tue Jan 14 22:56:13 2014 +0100
@@ -381,13 +381,20 @@
 
     WriteLnToConsole(msgGettingConfig);
 
-    if recordFileName = '' then
+    if cTestLua then
         begin
-        InitIPC;
-        SendIPCAndWaitReply(_S'C');        // ask for game config
+        ParseCommand('script ' + cScriptName, true);
         end
     else
-        LoadRecordFromFile(recordFileName);
+        begin
+        if recordFileName = '' then
+            begin
+            InitIPC;
+            SendIPCAndWaitReply(_S'C');        // ask for game config
+            end
+        else
+            LoadRecordFromFile(recordFileName);
+        end;
 
     ScriptOnGameInit;
     s:= 'eproto ' + inttostr(cNetProtoVersion);