From 3fefdde84d2b6ea9d0275a28af0c8d59a35c5a3f Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 27 Jul 2019 16:54:26 +0200 Subject: [PATCH] Fix a couple STATIC_INIT calls; compact STATIC_INIT(Registry_check_##id) code even more --- qcsrc/common/mutators/mutator/instagib/sv_instagib.qc | 2 +- qcsrc/common/mutators/mutator/overkill/sv_overkill.qc | 2 +- qcsrc/lib/registry.qh | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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); \ } \ -- 2.39.2