]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a couple STATIC_INIT calls; compact STATIC_INIT(Registry_check_##id) code even...
authorterencehill <piuntn@gmail.com>
Sat, 27 Jul 2019 14:54:26 +0000 (16:54 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 27 Jul 2019 14:54:26 +0000 (16:54 +0200)
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/lib/registry.qh

index fc571678b2c7f22ea1032f2f4a3d6e580cc83a02..63f3182ea6ba4746abb57d5491c5c97d29294adc 100644 (file)
@@ -18,7 +18,7 @@ int autocvar_g_instagib_extralives;
 float autocvar_g_instagib_speed_highspeed;
 
 IntrusiveList g_instagib_items;
-STATIC_INIT()
+STATIC_INIT(instagib)
 {
        g_instagib_items = IL_NEW();
        IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
index 15a2fc2e0c972427c1270223e0f40ad178609b81..41ba2da62b0ada5c48b9d9c1baa1dcdcb7074d2a 100644 (file)
@@ -11,7 +11,7 @@ bool autocvar_g_overkill_itemwaypoints = true;
 .Weapon ok_lastwep[MAX_WEAPONSLOTS];
 
 IntrusiveList g_overkill_items;
-STATIC_INIT()
+STATIC_INIT(overkill)
 {
        g_overkill_items = IL_NEW();
        IL_PUSH(g_overkill_items, ITEM_HealthMega);
index 4e8e09083f7749cb481655d64a0e01665f62b440..a48e83ac1a32593f7ccced9044b55de4308d7b79 100644 (file)
@@ -155,7 +155,7 @@ MACRO_END
 #define REGISTRY_HASH(id) Registry_hash_##id
 
 ERASEABLE
-ACCUMULATE void Registry_check(string r, string server) { }
+ACCUMULATE void Registry_check(string r, string sv) { }
 ERASEABLE
 ACCUMULATE void Registry_send_all() { }
 
@@ -170,9 +170,9 @@ void Registry_send(string id, string hash);
        STATIC_INIT(Registry_check_##id) \
        { \
                /* Note: SHA256 isn't always available, use MD4 instead */ \
-               string s = "", join = ":"; \
-               FOREACH(id, true, s = strcat(s, join, it.registered_id)); \
-               s = substring(s, strlen(join), -1); \
+               string s = ""; \
+               FOREACH(id, true, s = strcat(s, ":", it.registered_id)); \
+               s = substring(s, 1, -1); /* remove initial ":" */ \
                string h = REGISTRY_HASH(id) = strzone(digest_hex("MD4", s)); \
                LOG_DEBUGF(#id ": %s\n[%s]", h, s); \
        } \