]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/config.qh
Rename WR_PRECACHE to WR_INIT, which is more appropriate
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / config.qh
1 // ==========================
2 //  Balance Config Generator
3 // ==========================
4
5 void Dump_Weapon_Settings(void);
6 float wep_config_file;
7 float wep_config_alsoprint;
8
9 #define WEP_CONFIG_WRITE(a) { \
10         fputs(wep_config_file, a); \
11         if(wep_config_alsoprint) { print(a); } }
12
13 #define WEP_CONFIG_WRITE_CVARS(weapon,mode,name) \
14         #if mode == MO_PRI \
15                 { WEP_CONFIG_WRITE(sprintf( \
16                         "set g_balance_%s_primary_%s %g\n", \
17                         #weapon, \
18                         #name, \
19                         autocvar_g_balance_##weapon##_primary_##name)) } \
20         #endif \
21         #if mode == MO_SEC \
22                 { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %g\n", \
23                         #weapon, \
24                         #name, \
25                         autocvar_g_balance_##weapon##_secondary_##name)) } \
26         #endif \
27         #if mode == MO_BOTH \
28                 { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s %g\n", \
29                         #weapon, \
30                         #name, \
31                         autocvar_g_balance_##weapon##_primary_##name)) } \
32                 { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s %g\n", \
33                         #weapon, \
34                         #name, \
35                         autocvar_g_balance_##weapon##_secondary_##name)) } \
36         #endif \
37         #if mode == MO_NONE \
38                 { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %g\n", \
39                         #weapon, \
40                         #name, \
41                         autocvar_g_balance_##weapon##_##name)) } \
42         #endif
43         
44 #define WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \
45         { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s %g\n", \
46                         #weapon, \
47                         #name, \
48                         autocvar_g_balance_##weapon##_##name)) }