5 string strcat1(
string s) = #115;
9 const int REPLICATEVARS_SEND_ALL = -1;
10 const int REPLICATEVARS_CHECK = 0;
11 const int REPLICATEVARS_DESTROY = 1;
12 #define REPLICATE_INIT(type, name) type name 14 #define REPLICATE_INIT(type, name) .type name 28 #define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__)) 29 #define EVAL_REPLICATE(...) __VA_ARGS__ 41 #define REPLICATE_APPLYCHANGE(var, ApplyChange_code) \ 42 void ReplicateVars_ApplyChange(entity this, entity store, string thisname, int i) \ 43 { if (thisname == var) { ApplyChange_code } } 45 noref
float ReplicateVars_time;
48 if (
time < ReplicateVars_time)
50 ReplicateVars_time =
time + 0.8 +
random() * 0.4;
54 #define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, ) 55 #define REPLICATE_4(fld, type, var, func) REPLICATE_##type(fld, var, func) 57 #define REPLICATE_string(fld, var, func) \ 58 REPLICATE_7(fld, string, var, , \ 59 { strcpy(field, it); }, \ 60 { strfree(field); }, \ 63 string s = func(this, strcat1(field)); \ 69 #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , ) 70 #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, { field = boolean(stoi(it)); }, , ) 71 #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, { field = stoi(it); }, , ) 73 #define REPLICATE_7(fld, type, var, func, create, destroy, after) \ 74 void ReplicateVars(entity this, entity store, string thisname, int i) \ 76 type field = store.fld; \ 77 if (i < 0) { destroy } \ 80 string it = func(argv(i + 1)); \ 81 bool current = thisname == var; \ 84 if (current) { create } \ 88 stuffcmd(this, strcat("cl_cmd sendcvar ", var, "\n")); \ 90 if (current) { after } \ 95 #define REPLICATE_string(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar_string(var)), { strcpy(fld, cvar_string(var)); }, { strfree(fld); }) 96 #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar(var)), { fld = cvar(var); }, ) 97 #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, (fld != cvar(var)), { fld = cvar(var); }, ) 98 #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, (fld != cvar(var)), { fld = cvar(var); }, ) 100 void ReplicateVars_Send(
string cvarname) {
localcmd(
strcat(
"cl_cmd sendcvar ", cvarname,
"\n")); }
102 #define REPLICATE_7(fld, type, var, func, check, update, destroy) \ 103 void ReplicateVars(int mode) \ 105 if (mode == REPLICATEVARS_DESTROY) { destroy } \ 106 else if (mode == REPLICATEVARS_SEND_ALL || check) \ 108 ReplicateVars_Send(var); \ 113 #define REPLICATE_SIMPLE(field, cvarname) MACRO_BEGIN \ 114 float thecvar = cvar(cvarname); \ 115 if(field != thecvar) \ 117 ReplicateVars_Send(cvarname); \
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))