]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
damagetext: migrate legacy formatting
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 14 Mar 2016 04:04:48 +0000 (15:04 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 14 Mar 2016 04:05:30 +0000 (15:05 +1100)
Closes #1679

qcsrc/common/mutators/mutator/damagetext/damagetext.qc

index 70c57485314367a6eda9dfddd58d4336ca4c51c5..86adda03f7f8685c0743498d0e4e98ffbf577bd8 100644 (file)
@@ -14,6 +14,9 @@ REGISTER_MUTATOR(damagetext, true);
 // no translatable cvar description please
 AUTOCVAR_SAVE(cl_damagetext,                    bool,   false,      "Draw damage dealt where you hit the enemy");
 AUTOCVAR_SAVE(cl_damagetext_format,             string, "-{total}", "How to format the damage text. {health}, {armor}, {total}");
+STATIC_INIT(DamageText_LegacyFormat) {
+    if (strstrofs(autocvar_cl_damagetext_format, "{", 0) < 0) autocvar_cl_damagetext_format = "-{total}";
+}
 AUTOCVAR_SAVE(cl_damagetext_color,              vector, '1 1 0',    "Damage text color");
 AUTOCVAR_SAVE(cl_damagetext_color_per_weapon,   bool,   false,      "Damage text uses weapon color");
 AUTOCVAR_SAVE(cl_damagetext_size,               float,  8,          "Damage text font size");