X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fall.qh;h=3d0528a2511825742d89fd27ac0ecfc727a1d440;hb=d134ce0af0e04817a2a599f8187889d0a7bbc0ee;hp=8bd0b14b712c21a833d777951dc815a104af4efc;hpb=ee5353529c2fee304ac944aa19af53cc85eca7b0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/all.qh b/qcsrc/common/turrets/all.qh index 8bd0b14b7..3d0528a25 100644 --- a/qcsrc/common/turrets/all.qh +++ b/qcsrc/common/turrets/all.qh @@ -11,6 +11,51 @@ REGISTRY(Turrets, BITS(5)) REGISTER_REGISTRY(Turrets) REGISTRY_CHECK(Turrets) +#define TR_PROPS_COMMON(P, class, prefix) \ + P(class, prefix, aim_firetolerance_dist, float) \ + P(class, prefix, aim_maxpitch, float) \ + P(class, prefix, aim_maxrot, float) \ + P(class, prefix, aim_speed, float) \ + P(class, prefix, ammo_max, float) \ + P(class, prefix, ammo_recharge, float) \ + P(class, prefix, health, float) \ + P(class, prefix, respawntime, float) \ + P(class, prefix, shot_dmg, float) \ + P(class, prefix, shot_force, float) \ + P(class, prefix, shot_radius, float) \ + P(class, prefix, shot_refire, float) \ + P(class, prefix, shot_speed, float) \ + P(class, prefix, shot_spread, float) \ + P(class, prefix, shot_volly, float) \ + P(class, prefix, shot_volly_refire, float) \ + P(class, prefix, target_range, float) \ + P(class, prefix, target_range_min, float) \ + P(class, prefix, target_range_optimal, float) \ + P(class, prefix, target_select_anglebias, float) \ + P(class, prefix, target_select_missilebias, float) \ + P(class, prefix, target_select_playerbias, float) \ + P(class, prefix, target_select_rangebias, float) \ + P(class, prefix, target_select_samebias, float) \ + P(class, prefix, track_accel_pitch, float) \ + P(class, prefix, track_accel_rot, float) \ + P(class, prefix, track_blendrate, float) \ + P(class, prefix, track_type, float) \ + /**/ + +#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) +#ifdef SVQC + #define TR_CONFIG_BEGIN(class) METHOD(class, tr_config, void(class this)) { + #define _TR_CONFIG(class, fld, T, turname) if (#turname == this.netname) TUR_CONFIG_WRITE_CVARS(turname, fld, T); + #define TR_CONFIG_END() } +#else + #define TR_CONFIG_BEGIN(class) + #define _TR_CONFIG(class, fld, T, turname) + #define TR_CONFIG_END() +#endif GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt") { @@ -38,17 +83,17 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt") if(tur_config_file >= 0) { Dump_Turret_Settings(); - LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename)); + LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.", filename); fclose(tur_config_file); tur_config_file = -1; tur_config_alsoprint = -1; } else { - LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename)); + 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; } @@ -56,10 +101,10 @@ GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt") default: case CMD_REQUEST_USAGE: { - LOG_INFO(strcat("\nUsage:^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("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"); + 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; } }