#define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__))
#define EVAL_REPLICATE(...) __VA_ARGS__
- [[accumulate]] void ReplicateVars(entity this, entity store, string thisname, int i) {}
+ ACCUMULATE void ReplicateVars(entity this, entity store, string thisname, int i) {}
#define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )
#define REPLICATE_4(fld, type, var, func) REPLICATE_##type(fld, var, func)
#define REPLICATE_string(fld, var, func) \
REPLICATE_7(fld, string, var, , \
- { if (field) strunzone(field); field = strzone(it); }, \
- { if (field) strunzone(field); field = string_null; }, \
+ { strcpy(field, it); }, \
+ { strfree(field); }, \
{ \
/* also initialize to the default value of func when requesting cvars */ \
string s = func(field); \
if (s != field) \
{ \
- strunzone(field); \
- field = strzone(s); \
+ strcpy(field, s); \
} \
})
#define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , )