From: terencehill Date: Thu, 11 Apr 2019 15:24:11 +0000 (+0200) Subject: Compact 2 macros X-Git-Tag: xonotic-v0.8.5~1546^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8dc75a5ee7dff0fd8f41ec24df8d1cdde4cd6b8;p=xonotic%2Fxonotic-data.pk3dir.git Compact 2 macros --- diff --git a/qcsrc/common/turrets/config.qh b/qcsrc/common/turrets/config.qh index 2c47be091..274128381 100644 --- a/qcsrc/common/turrets/config.qh +++ b/qcsrc/common/turrets/config.qh @@ -1,15 +1,16 @@ #pragma once #ifdef SVQC +// ========================== +// Balance Config Generator +// ========================== void Dump_Turret_Settings(); float tur_config_file; float tur_config_alsoprint; float TUR_CONFIG_COUNT; -#define TUR_CONFIG_QUEUE(a) { \ - config_queue[TUR_CONFIG_COUNT] = a; \ - ++TUR_CONFIG_COUNT; } +#define TUR_CONFIG_QUEUE(a) config_queue[TUR_CONFIG_COUNT++] = a; #define TUR_CONFIG_WRITE_CVARS(turname, name, T) TUR_CONFIG_WRITE_PROPS_##T(turname, name) diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index bf34d5320..f9ff67393 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -48,7 +48,8 @@ void Dump_Weapon_Settings() it.m_name, ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "") )); - for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(config_queue[x]); } + for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) + WEP_CONFIG_WRITETOFILE(config_queue[x]); WEP_CONFIG_WRITETOFILE("// }}}\n"); // step 5: debug info diff --git a/qcsrc/common/weapons/config.qh b/qcsrc/common/weapons/config.qh index b21bf0170..26a37a7ce 100644 --- a/qcsrc/common/weapons/config.qh +++ b/qcsrc/common/weapons/config.qh @@ -10,10 +10,7 @@ int wep_config_file; bool wep_config_alsoprint; int WEP_CONFIG_COUNT; -#define WEP_CONFIG_QUEUE(a) { \ - config_queue[WEP_CONFIG_COUNT] = a; \ - ++WEP_CONFIG_COUNT; } - +#define WEP_CONFIG_QUEUE(a) config_queue[WEP_CONFIG_COUNT++] = a; #define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name)