]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/all.qh
Fix #2199 "sv_cmd dumpturrets doesn't work". The new implementation is similar to...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / all.qh
index fc3d5a7bc4ccbee3af11a5e2e577da16d5c7c65a..b82af599b0c5fec587b4a47ce6422bd291ee79e6 100644 (file)
@@ -11,6 +11,18 @@ REGISTRY(Turrets, BITS(5))
 REGISTER_REGISTRY(Turrets)
 REGISTRY_CHECK(Turrets)
 
+#define TR_PROPS(L, class, prefix) \
+       L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \
+       /**/ \
+
+#define TR_CONFIG(class, turname, fld, T)     _TR_CONFIG(class, fld, T, turname)
+#define TR_CONFIG_BEGIN(class) METHOD(class, tr_config, void(class this)) {
+       #ifdef SVQC
+               #define _TR_CONFIG(class, fld, T, turname) if (#turname == this.netname) TUR_CONFIG_WRITE_CVARS(turname, fld, T);
+       #else
+               #define _TR_CONFIG(class, fld, T, turname)
+       #endif
+#define TR_CONFIG_END() }
 
 GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
 {
@@ -48,7 +60,7 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
                 LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
             }
             #else
-            LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
+            LOG_INFO(_("Turrets dump command only works with sv_cmd."));
             #endif
             return;
         }
@@ -57,9 +69,9 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt")
         case CMD_REQUEST_USAGE:
         {
             LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
-            LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
-            LOG_INFO("  if supplied with '-' output to console as well as default,\n");
-            LOG_INFO("  if left blank, it will only write to default.\n");
+            LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),");
+            LOG_INFO("  if supplied with '-' output to console as well as default,");
+            LOG_INFO("  if left blank, it will only write to default.");
             return;
         }
     }