heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
// step 4: write queue
- WEP_CONFIG_WRITE(sprintf("// {{{ #%d: %s\n// %d settings\n", i, W_Name(i), WEP_CONFIG_COUNT))
+ WEP_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n// %d settings\n", i, W_Name(i), WEP_CONFIG_COUNT))
for(x = 0; x <= WEP_CONFIG_COUNT; ++x)
- { WEP_CONFIG_WRITE(wep_config_queue[x]) }
- WEP_CONFIG_WRITE("// }}}\n")
+ { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) }
+ WEP_CONFIG_WRITETOFILE("// }}}\n")
}
}
/*
wep_config_queue[WEP_CONFIG_COUNT] = a; \
++WEP_CONFIG_COUNT; }
-#define WEP_CONFIG_WRITE(a) { \
+#define WEP_CONFIG_WRITETOFILE(a) { \
fputs(wep_config_file, a); \
if(wep_config_alsoprint) { print(a); } }
#weapon, \
#name, \
autocvar_g_balance_##weapon##_##name)) }
+
+#define WEP_CONFIG_SETTINGS(wepsettings) \
+ #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) \
+ #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \
+ wepsettings \
+ #undef WEP_ADD_CVAR \
+ #undef WEP_ADD_PROP
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- ARC_SETTINGS(arc)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(ARC_SETTINGS(arc))
return TRUE;
}
case WR_KILLMESSAGE:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- CRYLINK_SETTINGS(crylink)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(CRYLINK_SETTINGS(crylink))
return TRUE;
}
case WR_RELOAD:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- DEVASTATOR_SETTINGS(devastator)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(DEVASTATOR_SETTINGS(devastator))
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- FIREBALL_SETTINGS(fireball)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(FIREBALL_SETTINGS(fireball))
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- HAGAR_SETTINGS(hagar)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(HAGAR_SETTINGS(hagar))
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- HOOK_SETTINGS(hook)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(HOOK_SETTINGS(hook))
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- UZI_SETTINGS(uzi)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(UZI_SETTINGS(uzi))
return TRUE;
}
case WR_RELOAD:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- MINELAYER_SETTINGS(minelayer)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(MINELAYER_SETTINGS(minelayer))
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- MORTAR_SETTINGS(mortar)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(MORTAR_SETTINGS(mortar))
return TRUE;
}
case WR_RELOAD:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- NEX_SETTINGS(nex)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(NEX_SETTINGS(nex))
return TRUE;
}
case WR_RELOAD:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- PORTO_SETTINGS(porto)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(PORTO_SETTINGS(porto))
return TRUE;
}
case WR_THINK:
}
case WR_CONFIG:
{
- #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name)
- RIFLE_SETTINGS(rifle)
- #undef WEP_ADD_CVAR
- #undef WEP_ADD_PROP
+ WEP_CONFIG_SETTINGS(RIFLE_SETTINGS(rifle))
return TRUE;
}
case WR_RESETPLAYER: