const int false = 0;
#endif
+#ifndef QCC_SUPPORT_ENTITYCLASS
+ #define entityclass(name) typedef entity name
+ #define class(name)
+ #define new(class) spawn()
+#else
+ #define entityclass(name) entityclass name {}
+ #define class(name) [[class(name)]]
+ #define new(class) ((class) spawn())
+#endif
+
// Transitional aliases
[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
{
me.saveCvars(me);
}
-void XonoticInputBox_setText(entity me, string new)
+void XonoticInputBox_setText(entity me, string val)
{
- if(me.text != new)
+ if(me.text != val)
{
- SUPER(XonoticInputBox).setText(me, new);
+ SUPER(XonoticInputBox).setText(me, val);
if(me.onChange)
me.onChange(me, me.onChangeEntity);
if(me.saveImmediately)
me.saveCvars(me);
}
else
- SUPER(XonoticInputBox).setText(me, new);
+ SUPER(XonoticInputBox).setText(me, val);
}
void XonoticInputBox_loadCvars(entity me)
{
void changematchtime(float delta, float mi, float ma)
{
float cur;
- float new;
+ float update;
float lim;
if(delta == 0)
if(lim == 0)
return; // cannot increase any further
else if(lim < ma)
- new = min(ma, lim + delta);
+ update = min(ma, lim + delta);
else // already above maximum: FAIL
return;
}
else
{
if(lim == 0) // infinite: try reducing to max, if we are allowed to
- new = max(mi, ma);
+ update = max(mi, ma);
else if(lim > mi) // above minimum: decrease
- new = max(mi, lim + delta);
+ update = max(mi, lim + delta);
else // already below minimum: FAIL
return;
}
- cvar_set("timelimit", ftos(new / 60));
+ cvar_set("timelimit", ftos(update / 60));
}
return stof(substring(dat, x-1, 1));
}
-string SetXBlock(float x, string dat, float new)
+string SetXBlock(float x, string dat, float val)
{
return strcat(
substring(dat, 0, x-1),
- ftos(new),
+ ftos(val),
substring(dat, x, -1)
);
}
{
float n, i;
string fn;
- vector prev, new;
+ vector prev, next;
float ft;
n = numentityfields();
{
fn = entityfieldname(i);
ft = entityfieldtype(i);
- new = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
+ next = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
prev = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", fn)));
if(prev.y == 0)
{
- db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(new));
+ db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(next));
if(fn == "target_spawn_spawnfunc")
target_spawn_spawnfunc_field = i;
}