hedgewars/uVideoRec.pas
changeset 15288 22f2fd8a3d2c
parent 14973 8e4e508d153c
child 15357 f53bfe04065e
--- a/hedgewars/uVideoRec.pas	Thu Jul 25 16:29:14 2019 +0300
+++ b/hedgewars/uVideoRec.pas	Mon Jul 22 19:26:58 2019 +0200
@@ -48,7 +48,7 @@
 procedure freeModule;
 
 implementation
-uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uTypes, uDebug;
+uses uVariables, GLunit, SDLh, SysUtils, uUtils, uSound, uIO, uMisc, uTypes, uDebug;
 
 type TAddFileLogRaw = procedure (s: pchar); cdecl;
 const AvwrapperLibName = 'libavwrapper';
@@ -286,6 +286,14 @@
 begin
     result:= 0;
     AddFileLog('BeginPreRecording');
+    // Videos don't work if /lua command was used, so we forbid them
+    if luaCmdUsed then
+        begin
+        // TODO: Show message to player
+        PlaySound(sndDenied);
+        AddFileLog('Pre-recording prevented; /lua command was used before');
+        exit;
+        end;
 
     thumbnailSaved:= false;
     RecPrefix:= 'hw-' + FormatDateTime('YYYY-MM-DD_HH-mm-ss-z', TDateTime(Now()));