-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathrulesets.c
642 lines (555 loc) · 18.5 KB
/
rulesets.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
/*
Copyright (C) 2001-2002 A Nourai
Copyright (C) 2015 ezQuake team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the included (GNU.txt) GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include "gl_model.h"
#include "gl_local.h"
#include "rulesets.h"
#include "mp3_player.h"
#include "input.h"
/* FIXME: Figure out a nicer way to do all this */
static void Rulesets_OnChange_ruleset (cvar_t *var, char *value, qbool *cancel);
static rulesetDef_t rulesetDef = {
rs_default,
72.0,
false,
false,
false
};
cvar_t ruleset = {"ruleset", "default", 0, Rulesets_OnChange_ruleset};
qbool RuleSets_DisallowExternalTexture(model_t *mod)
{
switch (mod->modhint) {
case MOD_EYES:
return true;
case MOD_BACKPACK:
return rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_thunderdome || rulesetDef.ruleset == rs_qcon;
default:
return false;
}
}
qbool RuleSets_DisallowModelOutline(model_t *mod)
{
switch (mod->modhint) {
case MOD_EYES:
return true;
case MOD_THUNDERBOLT:
return true;
case MOD_BACKPACK:
return rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_thunderdome;
default:
return rulesetDef.ruleset == rs_qcon;
}
}
qbool Rulesets_AllowTimerefresh(void)
{
switch(rulesetDef.ruleset) {
case rs_smackdown:
case rs_thunderdome:
case rs_qcon:
return (cl.standby || cl.spectator || cls.demoplayback);
default:
return true;
}
}
qbool Rulesets_AllowNoShadows(void)
{
switch(rulesetDef.ruleset) {
case rs_mtfl:
case rs_smackdown:
case rs_thunderdome:
case rs_qcon:
return false;
default:
return true;
}
}
qbool Rulesets_AllowAlternateModel (const char* modelName)
{
switch(rulesetDef.ruleset) {
case rs_qcon:
if (! strcmp (modelName, "progs/player.mdl"))
return false;
return true;
default:
return true;
}
}
float Rulesets_MaxFPS(void)
{
if (cl_multiview.value && cls.mvdplayback)
return nNumViews*rulesetDef.maxfps;
return rulesetDef.maxfps;
}
qbool Rulesets_RestrictTriggers(void)
{
return rulesetDef.restrictTriggers;
}
qbool Rulesets_RestrictSound(void)
{
return rulesetDef.restrictSound && cbuf_current != &cbuf_svc;
}
qbool Rulesets_RestrictPacket(void)
{
return !cl.spectator && !cls.demoplayback && !cl.standby && rulesetDef.restrictPacket;
}
qbool Rulesets_RestrictParticles(void)
{
return !cl.spectator && !cls.demoplayback && !cl.standby && rulesetDef.restrictParticles && !r_refdef2.allow_cheats;
}
qbool Rulesets_RestrictTCL(void)
{
switch(rulesetDef.ruleset) {
case rs_smackdown:
case rs_thunderdome:
case rs_qcon:
return true;
case rs_mtfl:
default:
return false;
}
}
const char *Rulesets_Ruleset(void)
{
switch(rulesetDef.ruleset) {
case rs_mtfl:
return "MTFL";
case rs_smackdown:
return "smackdown";
case rs_thunderdome:
return "thunderdome";
case rs_qcon:
return "qcon";
default:
return "default";
}
}
static void Rulesets_Smackdown(qbool enable)
{
extern cvar_t cl_independentPhysics, cl_c2spps;
extern cvar_t cl_hud;
extern cvar_t cl_rollalpha;
extern cvar_t r_shiftbeam;
extern cvar_t allow_scripts;
extern cvar_t cl_iDrive;
int i;
locked_cvar_t disabled_cvars[] = {
{&allow_scripts, "0"}, // disable movement scripting
{&cl_iDrive, "0"}, // disable strafing aid
{&cl_hud, "0"}, // allows you place any text on the screen & filter incoming messages (hud strings)
{&cl_rollalpha, "20"}, // allows you to not dodge while seeing enemies dodging
{&r_shiftbeam, "0"} // perphaps some people would think this allows you to aim better (maybe should be added for demo playback and spectating only)
};
if (enable) {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) {
Cvar_RulesetSet(disabled_cvars[i].var, disabled_cvars[i].value, 2);
Cvar_Set(disabled_cvars[i].var, disabled_cvars[i].value);
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) | CVAR_ROM);
}
if (cl_independentPhysics.value) {
Cvar_Set(&cl_c2spps, "0"); // people were complaining that player move is jerky with this. however this has not much to do with independent physics, but people are too paranoid about it
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) | CVAR_ROM);
}
rulesetDef.maxfps = 77;
rulesetDef.restrictTriggers = true;
rulesetDef.restrictPacket = true; // packet command could have been exploited for external timers
rulesetDef.restrictParticles = true;
rulesetDef.ruleset = rs_smackdown;
} else {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++)
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) & ~CVAR_ROM);
if (cl_independentPhysics.value)
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) & ~CVAR_ROM);
rulesetDef.maxfps = 72.0;
rulesetDef.restrictTriggers = false;
rulesetDef.restrictPacket = false;
rulesetDef.restrictParticles = false;
rulesetDef.ruleset = rs_default;
}
}
static void Rulesets_Qcon(qbool enable)
{
extern cvar_t cl_independentPhysics, cl_c2spps;
extern cvar_t cl_hud;
extern cvar_t cl_rollalpha;
extern cvar_t r_shiftbeam;
extern cvar_t allow_scripts;
extern cvar_t cl_iDrive;
int i;
locked_cvar_t disabled_cvars[] = {
{&allow_scripts, "0"}, // disable movement scripting
{&cl_iDrive, "0"}, // disable strafing aid
{&cl_hud, "0"}, // allows you place any text on the screen & filter incoming messages (hud strings)
{&cl_rollalpha, "20"}, // allows you to not dodge while seeing enemies dodging
{&r_shiftbeam, "0"} // perphaps some people would think this allows you to aim better (maybe should be added for demo playback and spectating only)
};
if (enable) {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) {
Cvar_RulesetSet(disabled_cvars[i].var, disabled_cvars[i].value, 2);
Cvar_Set(disabled_cvars[i].var, disabled_cvars[i].value);
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) | CVAR_ROM);
}
if (cl_independentPhysics.value) {
Cvar_Set(&cl_c2spps, "0"); // people were complaining that player move is jerky with this. however this has not much to do with independent physics, but people are too paranoid about it
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) | CVAR_ROM);
}
rulesetDef.maxfps = 77;
rulesetDef.restrictTriggers = true;
rulesetDef.restrictPacket = true; // packet command could have been exploited for external timers
rulesetDef.restrictParticles = true;
rulesetDef.restrictSound = true;
rulesetDef.ruleset = rs_qcon;
MP3_Shutdown ();
} else {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++)
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) & ~CVAR_ROM);
if (cl_independentPhysics.value)
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) & ~CVAR_ROM);
rulesetDef.maxfps = 72.0;
rulesetDef.restrictTriggers = false;
rulesetDef.restrictPacket = false;
rulesetDef.restrictParticles = false;
rulesetDef.restrictSound = false;
rulesetDef.ruleset = rs_default;
}
}
static void Rulesets_Thunderdome(qbool enable)
{
extern cvar_t cl_independentPhysics, cl_c2spps;
extern cvar_t cl_hud;
extern cvar_t r_shiftbeam;
extern cvar_t allow_scripts;
extern cvar_t cl_iDrive;
int i;
locked_cvar_t disabled_cvars[] = {
{&allow_scripts, "0"}, // disable movement scripting
{&cl_iDrive, "0"}, // disable strafing aid
{&cl_hud, "0"}, // allows you place any text on the screen & filter incoming messages (hud strings)
{&r_shiftbeam, "0"} // perphaps some people would think this allows you to aim better (maybe should be added for demo playback and spectating only)
};
if (enable) {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) {
Cvar_RulesetSet(disabled_cvars[i].var, disabled_cvars[i].value, 2);
Cvar_Set(disabled_cvars[i].var, disabled_cvars[i].value);
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) | CVAR_ROM);
}
if (cl_independentPhysics.value) {
Cvar_Set(&cl_c2spps, "0"); // people were complaining that player move is jerky with this. however this has not much to do with independent physics, but people are too paranoid about it
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) | CVAR_ROM);
}
rulesetDef.maxfps = 77;
rulesetDef.restrictTriggers = true;
rulesetDef.restrictPacket = true; // packet command could have been exploited for external timers
rulesetDef.restrictParticles = false;
rulesetDef.ruleset = rs_thunderdome;
} else {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++)
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) & ~CVAR_ROM);
if (cl_independentPhysics.value)
Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) & ~CVAR_ROM);
rulesetDef.maxfps = 72.0;
rulesetDef.restrictTriggers = false;
rulesetDef.restrictPacket = false;
rulesetDef.restrictParticles = false;
rulesetDef.ruleset = rs_default;
}
}
static void Rulesets_MTFL(qbool enable)
{
/* TODO:
f_flashout trigger
block all other ways to made textures flat(simple)
?disable external textures for detpacks, grenades, sentry, disp, etc?
*/
extern cvar_t cl_c2spps, r_fullbrightSkins;
extern cvar_t amf_detpacklights;
extern cvar_t gl_picmip, gl_max_size, r_drawflat;
extern cvar_t gl_textureless;
int i = 0;
locked_cvar_t disabled_cvars[] = {
{&r_drawflat, "0"},
{&amf_detpacklights, "0"},
{&gl_textureless, "0"},
{&r_fullbrightSkins, "0"},
{&cl_c2spps, "0"},
};
limited_cvar_max_t limited_max_cvars[] = {
{&gl_picmip, "3"},
};
limited_cvar_min_t limited_min_cvars[] = {
{&gl_max_size, "512"},
};
if (enable) {
for (; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) {
Cvar_RulesetSet(disabled_cvars[i].var, disabled_cvars[i].value, 2);
Cvar_Set(disabled_cvars[i].var, disabled_cvars[i].value);
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) | CVAR_ROM);
}
for (i = 0; i < (sizeof(limited_max_cvars) / sizeof(limited_max_cvars[0])); i++) {
Cvar_RulesetSet(limited_max_cvars[i].var, limited_max_cvars[i].maxrulesetvalue, 1);
Cvar_SetFlags(limited_max_cvars[i].var, Cvar_GetFlags(limited_max_cvars[i].var) | CVAR_RULESET_MAX);
}
for (i = 0; i < (sizeof(limited_min_cvars) / sizeof(limited_min_cvars[0])); i++) {
Cvar_RulesetSet(limited_min_cvars[i].var, limited_min_cvars[i].minrulesetvalue, 0);
Cvar_SetFlags(limited_min_cvars[i].var, Cvar_GetFlags(limited_min_cvars[i].var) | CVAR_RULESET_MIN);
}
rulesetDef.ruleset = rs_mtfl;
} else {
for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++)
Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) & ~CVAR_ROM);
for (i = 0; i < (sizeof(limited_max_cvars) / sizeof(limited_max_cvars[0])); i++)
Cvar_SetFlags(limited_max_cvars[i].var, Cvar_GetFlags(limited_max_cvars[i].var) & ~CVAR_RULESET_MAX);
for (i = 0; i < (sizeof(limited_min_cvars) / sizeof(limited_min_cvars[0])); i++)
Cvar_SetFlags(limited_min_cvars[i].var, Cvar_GetFlags(limited_min_cvars[i].var) & ~CVAR_RULESET_MIN);
rulesetDef.ruleset = rs_default;
}
}
static void Rulesets_Default(void)
{
rulesetDef.ruleset = rs_default;
}
void Rulesets_Init(void)
{
int temp;
Cvar_SetCurrentGroup(CVAR_GROUP_USERINFO);
Cvar_Register(&ruleset);
if ((temp = COM_CheckParm("-ruleset")) && temp + 1 < COM_Argc()) {
if (!strcasecmp(COM_Argv(temp + 1), "smackdown")) {
Cvar_Set(&ruleset, "smackdown");
return;
} else if (!strcasecmp(COM_Argv(temp + 1), "thunderdome")) {
Cvar_Set(&ruleset, "thunderdome");
return;
} else if (!strcasecmp(COM_Argv(temp + 1), "mtfl")) {
Cvar_Set(&ruleset, "mtfl");
return;
} else if (strcasecmp(COM_Argv(temp + 1), "qcon")) {
Cvar_Set(&ruleset, "qcon");
return;
} else if (strcasecmp(COM_Argv(temp + 1), "default")){
Cvar_Set(&ruleset, "default");
return;
} else {
Rulesets_Default();
return;
}
}
}
void Rulesets_OnChange_indphys(cvar_t *var, char *value, qbool *cancel)
{
if (cls.state != ca_disconnected) {
Com_Printf("%s can be changed only when disconnected\n", var->name);
*cancel = true;
}
else *cancel = false;
}
void Rulesets_OnChange_r_fullbrightSkins(cvar_t *var, char *value, qbool *cancel)
{
char *fbs;
qbool fbskins_policy = (cls.demoplayback || cl.spectator) ? 1 :
*(fbs = Info_ValueForKey(cl.serverinfo, "fbskins")) ? bound(0, Q_atof(fbs), 1) :
cl.teamfortress ? 0 : 1;
float fbskins = bound(0.0, Q_atof (value), fbskins_policy);
if (!cl.spectator && cls.state != ca_disconnected) {
if (fbskins > 0.0) {
Cbuf_AddText(va("say all skins %d%% fullbright\n", (int) (fbskins * 100.0)));
} else {
Cbuf_AddText(va("say not using fullbright skins\n"));
}
}
}
void Rulesets_OnChange_allow_scripts (cvar_t *var, char *value, qbool *cancel)
{
char *p;
qbool progress;
int val;
p = Info_ValueForKey(cl.serverinfo, "status");
progress = (strstr (p, "left")) ? true : false;
val = Q_atoi(value);;
if (cls.state >= ca_connected && progress && !cl.spectator) {
Com_Printf ("%s changes are not allowed during the match.\n", var->name);
*cancel = true;
return;
}
IN_ClearProtectedKeys ();
if (!cl.spectator && cls.state != ca_disconnected) {
if (val < 1) {
Cbuf_AddText("say not using scripts\n");
} else if (val < 2) {
Cbuf_AddText("say using simple scripts\n");
} else {
Cbuf_AddText("say using advanced scripts\n");
}
}
}
void Rulesets_OnChange_cl_delay_packet(cvar_t *var, char *value, qbool *cancel)
{
int ival = Q_atoi(value); // this is used in the code
float fval = Q_atof(value); // this is used to check value validity
if (ival == var->integer && fval == var->value) {
// no change
return;
}
if (fval < 0) {
Com_Printf("%s doesn't allow negative values\n", var->name);
*cancel = true;
return;
}
if (cls.state == ca_active) {
if ((cl.standby) || (cl.teamfortress)) {
// allow in standby or teamfortress. For teamfortress, more often than not
// People 1on1 without "match mode" and they may want to sync pings.
Cbuf_AddText(va("say delay packet: %d ms\n", ival));
} else {
// disallow during the match
Com_Printf("%s changes are not allowed during the match\n", var->name);
*cancel = true;
}
} else {
// allow in not fully connected state
}
}
void Rulesets_OnChange_cl_iDrive(cvar_t *var, char *value, qbool *cancel)
{
int ival = Q_atoi(value); // this is used in the code
float fval = Q_atof(value); // this is used to check value validity
if (ival == var->integer && fval == var->value) {
// no change
return;
}
if (fval != 0 && fval != 1) {
Com_Printf("Invalid value for %s, use 0 or 1.\n", var->name);
*cancel = true;
return;
}
if (cls.state == ca_active) {
if (cl.standby) {
// allow in standby
Cbuf_AddText(va("say side step aid (strafescript): %s\n", ival ? "on" : "off"));
}
else {
// disallow during the match
Com_Printf("%s changes are not allowed during the match\n", var->name);
*cancel = true;
}
} else {
// allow in not fully connected state
}
}
void Rulesets_OnChange_cl_fakeshaft(cvar_t *var, char *value, qbool *cancel)
{
float fakeshaft = Q_atof(value);
if (!cl.spectator && cls.state != ca_disconnected) {
if (fakeshaft == 2)
Cbuf_AddText("say fakeshaft 2 (emulation of fakeshaft 0 for servers with antilag feature)\n");
else if (fakeshaft > 0.999)
Cbuf_AddText("say fakeshaft on\n");
else if (fakeshaft < 0.001)
Cbuf_AddText("say fakeshaft off\n");
else
Cbuf_AddText(va("say fakeshaft %.1f%%\n", fakeshaft * 100.0));
}
}
static void Rulesets_OnChange_ruleset(cvar_t *var, char *value, qbool *cancel)
{
extern void Cmd_ReInitAllMacro(void);
if (cls.state != ca_disconnected) {
Com_Printf("%s can be changed only when disconnected\n", var->name);
*cancel = true;
return;
}
if (strncasecmp(value, "smackdown", sizeof("smackdown")) &&
strncasecmp(value, "thunderdome", sizeof("thunderdome")) &&
strncasecmp(value, "mtfl", sizeof("mtfl")) &&
strncasecmp(value, "qcon", sizeof("qcon")) &&
strncasecmp(value, "default", sizeof("default"))) {
Com_Printf_State(PRINT_INFO, "Unknown ruleset \"%s\"\n", value);
*cancel = true;
return;
}
// All checks passed so we can remove old ruleset and set a new one
switch (rulesetDef.ruleset) {
case rs_mtfl:
Rulesets_MTFL(false);
break;
case rs_smackdown:
Rulesets_Smackdown(false);
break;
case rs_qcon:
Rulesets_Qcon(false);
break;
case rs_thunderdome:
Rulesets_Thunderdome(false);
break;
case rs_default:
break;
default:
break;
}
// we need to mark custom textures in the memory (like for backpack and eyes) to be reloaded again
Cache_Flush();
if (!strncasecmp(value, "smackdown", sizeof("smackdown"))) {
Rulesets_Smackdown(true);
Com_Printf_State(PRINT_OK, "Ruleset Smackdown initialized\n");
} else if (!strncasecmp(value, "mtfl", sizeof("mtfl"))) {
Rulesets_MTFL(true);
Com_Printf_State(PRINT_OK, "Ruleset MTFL initialized\n");
} else if (!strncasecmp(value, "thunderdome", sizeof("thunderdome"))) {
Rulesets_Thunderdome(true);
Com_Printf_State(PRINT_OK, "Ruleset Thunderdome initialized\n");
} else if (!strncasecmp(value, "qcon", sizeof("qcon"))) {
Rulesets_Qcon(true);
Com_Printf_State(PRINT_OK, "Ruleset Qcon initialized\n");
} else if (!strncasecmp(value, "default", sizeof("default"))) {
Rulesets_Default();
Com_Printf_State(PRINT_OK, "Ruleset default initialized\n");
} else {
Sys_Error("OnChange_ruleset: WTF?\n");
// this will never happen
*cancel = true;
return;
}
Cmd_ReInitAllMacro();
IN_ClearProtectedKeys();
}
int Rulesets_MaxSequentialWaitCommands(void)
{
switch (rulesetDef.ruleset) {
case rs_qcon:
return 10;
default:
return 32768;
}
}
qbool Ruleset_BlockHudPicChange(void)
{
switch (rulesetDef.ruleset) {
case rs_qcon:
return cls.state != ca_disconnected && !(cl.standby || cl.spectator || cls.demoplayback);
default:
return false;
}
}
qbool Ruleset_AllowPolygonOffset(entity_t* ent)
{
switch (rulesetDef.ruleset) {
case rs_qcon:
return false;
case rs_default:
return true;
default:
return ent->model && ent->model->isworldmodel;
}
}