]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/effectinfo.qc
effectinfo: regenerate effectinfo.txt
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / effectinfo.qc
index 6d5732d2f2e6fd70524218dfc6c0bf325c01f253..e27d2c9ffa71cad5776cf61122768ea3d44f6281 100644 (file)
@@ -259,12 +259,28 @@ void effectinfo_read()
 
 void effectinfo_dump(int fh, bool alsoprint)
 {
+    #define WRITE(s) do { \
+        fputs(fh, s); \
+        if (alsoprint) LOG_INFO(s); \
+    } while (0)
+    WRITE("// ********************************************** //\n");
+    WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
+    WRITE("// **                                          ** //\n");
+    WRITE("// **  This file is automatically generated by ** //\n");
+    WRITE("// **  code with the command 'dumpeffectinfo'. ** //\n");
+    WRITE("// **                                          ** //\n");
+    WRITE("// **  If you modify an effect, please         ** //\n");
+    WRITE("// **  regenerate this file with that command. ** //\n");
+    WRITE("// **                                          ** //\n");
+    WRITE("// ********************************************** //\n");
+    WRITE("\n");
+
     for (EffectInfo it = NULL; (it = findfloat(it, instanceOfEffectInfo, true)); ) {
         if (it.classname == "vtbl") continue;
         string s = it.dump(it);
-        fputs(fh, s);
-        if (alsoprint) print(s);
+        WRITE(s);
     }
+    #undef WRITE
 }