pull in nicer fix
authornemo
Thu, 13 Dec 2018 12:12:40 -0500
changeset 14445 2c4f71779302
parent 14442 94f10f69fe76 (current diff)
parent 14444 a32b967f1341 (diff)
child 14453 05ca0057d71f
pull in nicer fix
--- a/hedgewars/hwengine.pas	Thu Dec 13 10:51:07 2018 -0500
+++ b/hedgewars/hwengine.pas	Thu Dec 13 12:12:40 2018 -0500
@@ -140,12 +140,14 @@
     if flagMakeCapture then
         begin
         flagMakeCapture:= false;
-        {$IFNDEF PAS2C}
         if flagDumpLand then
              s:= '/Screenshots/mapdump_'
         else s:= '/Screenshots/hw_';
+        {$IFDEF PAS2C}
         s:= s + inttostr(GameTicks);
+        {$ELSE}
         s:= s + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
+        {$ENDIF}
 
         // flash
         playSound(sndShutter);
@@ -161,7 +163,6 @@
             WriteLnToConsole('Screenshot failed.');
             AddChatString(#5 + 'screen capture failed (lack of memory or write permissions)');
             end
-        {$ENDIF}
         end;
 end;
 
--- a/project_files/hwc/rtl/fileio.c	Thu Dec 13 10:51:07 2018 -0500
+++ b/project_files/hwc/rtl/fileio.c	Thu Dec 13 12:12:40 2018 -0500
@@ -186,7 +186,8 @@
  */
 void fpcrtl_blockWrite__vars(File f, const void *buf, Integer count,
         Integer *result) {
-    assert(0);
+    assert(f->record_len > 0);
+    *result = fwrite(buf, f->record_len, count, f->fp);
 }
 
 bool fpcrtl_directoryExists(string255 dir) {