From d8dc75a5ee7dff0fd8f41ec24df8d1cdde4cd6b8 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 11 Apr 2019 17:24:11 +0200 Subject: [PATCH] Compact 2 macros --- qcsrc/common/turrets/config.qh | 7 ++++--- qcsrc/common/weapons/config.qc | 3 ++- qcsrc/common/weapons/config.qh | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) 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) -- 2.39.2