REGISTER_MUTATOR(damagetext, true);
#if defined(CSQC) || defined(MENUQC)
-AUTOCVAR(cl_damagetext, bool, false, _("Draw damage dealt. 0: disabled, 1: enabled"));
-AUTOCVAR(cl_damagetext_format, string, "-%3$d", _("How to format the damage text. 1$ is health, 2$ is armor, 3$ is both"));
-AUTOCVAR(cl_damagetext_color, vector, '1 1 0', _("Default damage text color"));
-AUTOCVAR(cl_damagetext_size, float, 8, _("Damage text font size"));
-AUTOCVAR(cl_damagetext_alpha_start, float, 1, _("Damage text initial alpha"));
-AUTOCVAR(cl_damagetext_alpha_lifetime, float, 3, _("Damage text lifetime in seconds"));
-AUTOCVAR(cl_damagetext_velocity, vector, '0 0 20', _("Damage text move direction"));
-AUTOCVAR(cl_damagetext_offset, vector, '0 -40 0', _("Damage text offset"));
-AUTOCVAR(cl_damagetext_accumulate_range, float, 30, _("Damage text spawned within this range is accumulated"));
+AUTOCVAR_SAVE(cl_damagetext, bool, false, _("Draw damage dealt. 0: disabled, 1: enabled"));
+AUTOCVAR_SAVE(cl_damagetext_format, string, "-%3$d", _("How to format the damage text. 1$ is health, 2$ is armor, 3$ is both"));
+AUTOCVAR_SAVE(cl_damagetext_color, vector, '1 1 0', _("Default damage text color"));
+AUTOCVAR_SAVE(cl_damagetext_size, float, 8, _("Damage text font size"));
+AUTOCVAR_SAVE(cl_damagetext_alpha_start, float, 1, _("Damage text initial alpha"));
+AUTOCVAR_SAVE(cl_damagetext_alpha_lifetime, float, 3, _("Damage text lifetime in seconds"));
+AUTOCVAR_SAVE(cl_damagetext_velocity, vector, '0 0 20', _("Damage text move direction"));
+AUTOCVAR_SAVE(cl_damagetext_offset, vector, '0 -40 0', _("Damage text offset"));
+AUTOCVAR_SAVE(cl_damagetext_accumulate_range, float, 30, _("Damage text spawned within this range is accumulated"));
#endif
#ifdef CSQC
#endif
#ifdef SVQC
-int autocvar_sv_damagetext = 2;
-STATIC_INIT(sv_damagetext) {
- CVAR_DESCRIBE(sv_damagetext, _("<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players"));
-}
+AUTOCVAR(sv_damagetext, int, 2, _("<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players"));
#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 /* disabled */)
#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1 /* spectators only */)
#define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2 /* players */)
#ifndef CVAR_H
#define CVAR_H
-#define CVAR_DESCRIBE(var, desc) localcmd(sprintf("\nseta %1$s \"$%1$s\" \"%2$s\"\n", #var, desc))
+#define CVAR_DESCRIBE(set, var, desc) localcmd(sprintf("\n"set" %1$s \"$%1$s\" \"%2$s\"\n", #var, desc))
-#define AUTOCVAR_3(var, type, desc) \
- STATIC_INIT(autocvar_##var) { CVAR_DESCRIBE(var, desc); } \
+#define AUTOCVAR_4(set, var, type, desc) \
+ STATIC_INIT(autocvar_##var) { CVAR_DESCRIBE(set, var, desc); } \
type autocvar_##var
-#define AUTOCVAR_4(var, type, default, desc) \
- AUTOCVAR_3(var, type, desc) = default
-#define AUTOCVAR(...) OVERLOAD(AUTOCVAR, __VA_ARGS__)
+#define AUTOCVAR_5(set, var, type, default, desc) \
+ AUTOCVAR_4(set, var, type, desc) = default
+#define _AUTOCVAR(...) OVERLOAD(AUTOCVAR, __VA_ARGS__)
+#define AUTOCVAR_SAVE(...) _AUTOCVAR("seta", __VA_ARGS__)
+#define AUTOCVAR(...) _AUTOCVAR("set", __VA_ARGS__)
#endif