vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
//vector autocvar_sv_player_headsize = '24 24 12';
+
+// temporary array used to dump weapon and turret settings
+const int MAX_CONFIG_SETTINGS = 256;
+string config_queue[MAX_CONFIG_SETTINGS];
+
#endif
void T_Config_Queue_Swap(float root, float child, entity pass)
{
- string oldroot = tur_config_queue[root];
- tur_config_queue[root] = tur_config_queue[child];
- tur_config_queue[child] = oldroot;
+ string oldroot = config_queue[root];
+ config_queue[root] = config_queue[child];
+ config_queue[child] = oldroot;
}
float T_Config_Queue_Compare(float root, float child, entity pass)
for(i = 1; i <= 100; ++i)
{
- r = str2chr(tur_config_queue[root], i);
- c = str2chr(tur_config_queue[child], i);
+ r = str2chr(config_queue[root], i);
+ c = str2chr(config_queue[child], i);
if(r == c) { continue; }
else if(c > r) { return -1; }
else { return 1; }
FOREACH(Turrets, it != TUR_Null, {
// step 1: clear the queue
TUR_CONFIG_COUNT = 0;
- for(int j = 0; j <= MAX_TUR_CONFIG; ++j)
- { tur_config_queue[j] = string_null; }
+ for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j)
+ config_queue[j] = string_null;
// step 2: build new queue
it.tr_config(it);
// step 4: write queue
TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
for(int j = 0; j <= TUR_CONFIG_COUNT; ++j)
- { TUR_CONFIG_WRITETOFILE(tur_config_queue[j]) }
+ TUR_CONFIG_WRITETOFILE(config_queue[j])
TUR_CONFIG_WRITETOFILE("// }}}\n")
// step 5: debug info
// clear queue now that we're finished
TUR_CONFIG_COUNT = 0;
- for(int j = 0; j <= MAX_TUR_CONFIG; ++j)
- { tur_config_queue[j] = string_null; }
+ for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j)
+ config_queue[j] = string_null;
// extra information
LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
float tur_config_file;
float tur_config_alsoprint;
-const int MAX_TUR_CONFIG = 256;
float TUR_CONFIG_COUNT;
-string tur_config_queue[MAX_TUR_CONFIG];
-
#define TUR_CONFIG_WRITETOFILE(a) { \
fputs(tur_config_file, a); \
if(tur_config_alsoprint) { LOG_INFO(a); } }
void W_Config_Queue_Swap(int root, int child, entity pass)
{
- string oldroot = wep_config_queue[root];
- wep_config_queue[root] = wep_config_queue[child];
- wep_config_queue[child] = oldroot;
+ string oldroot = config_queue[root];
+ config_queue[root] = config_queue[child];
+ config_queue[child] = oldroot;
}
float W_Config_Queue_Compare(int root, int child, entity pass)
{
- return strcmp(wep_config_queue[root], wep_config_queue[child]);
+ return strcmp(config_queue[root], config_queue[child]);
}
void Dump_Weapon_Settings()
FOREACH(Weapons, it != WEP_Null, {
// step 1: clear the queue
WEP_CONFIG_COUNT = 0;
- for (int x = 0; x <= MAX_WEP_CONFIG; ++x)
- { wep_config_queue[x] = string_null; }
+ for (int x = 0; x <= MAX_CONFIG_SETTINGS; ++x)
+ config_queue[x] = string_null;
// step 2: build new queue
it.wr_config(it);
it.m_name,
((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
));
- for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_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
// clear queue now that we're finished
WEP_CONFIG_COUNT = 0;
- for(int x = 0; x <= MAX_WEP_CONFIG; ++x)
- { wep_config_queue[x] = string_null; }
+ for(int x = 0; x <= MAX_CONFIG_SETTINGS; ++x)
+ config_queue[x] = string_null;
// extra information
LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings));
int wep_config_file;
bool wep_config_alsoprint;
-const int MAX_WEP_CONFIG = 256;
int WEP_CONFIG_COUNT;
-string wep_config_queue[MAX_WEP_CONFIG];
-
#define WEP_CONFIG_QUEUE(a) { \
- wep_config_queue[WEP_CONFIG_COUNT] = a; \
+ config_queue[WEP_CONFIG_COUNT] = a; \
++WEP_CONFIG_COUNT; }
#define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN { \