From: terencehill Date: Sat, 27 Jul 2019 14:54:26 +0000 (+0200) Subject: Fix a couple STATIC_INIT calls; compact STATIC_INIT(Registry_check_##id) code even... X-Git-Tag: xonotic-v0.8.5~1443 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=3fefdde84d2b6ea9d0275a28af0c8d59a35c5a3f;p=xonotic%2Fxonotic-data.pk3dir.git Fix a couple STATIC_INIT calls; compact STATIC_INIT(Registry_check_##id) code even more --- diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index fc571678b..63f3182ea 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -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); diff --git a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index 15a2fc2e0..41ba2da62 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -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); diff --git a/qcsrc/lib/registry.qh b/qcsrc/lib/registry.qh index 4e8e09083..a48e83ac1 100644 --- a/qcsrc/lib/registry.qh +++ b/qcsrc/lib/registry.qh @@ -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); \ } \