fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
if(self.lodmodelindex1)
{
InterpolateOrigin_Do();
- self.saved = self.fld;
+ self.saved = self.(fld);
f = BGMScript(self);
if(f >= 0)
self.alpha = 1 + self.lip * f;
else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip)
self.alpha = 1 - self.lip * (1 - f);
- self.fld = self.fld + self.movedir * f;
+ self.(fld) = self.(fld) + self.movedir * f;
}
else
self.alpha = 1;
fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
f = ReadByte();
InterpolateOrigin_Note();
- self.saved = self.fld;
+ self.saved = self.(fld);
self.entremove = Ent_Wall_Remove;
self.draw = Ent_Wall_Draw;
upper = lower;
if(e.frame1time != upper.y || e.frame2time != lower.y)
BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
- e.fld_frame = upper.x;
- e.fld_frame1time = upper.y;
- e.fld_frame2 = lower.x;
- e.fld_frame2time = lower.y;
+ e.(fld_frame) = upper.x;
+ e.(fld_frame1time) = upper.y;
+ e.(fld_frame2) = lower.x;
+ e.(fld_frame2time) = lower.y;
}
else
{
upper = lower;
if(e.frame1time != upper.y)
BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
- e.fld_frame = upper.x;
- e.fld_frame1time = upper.y;
+ e.(fld_frame) = upper.x;
+ e.(fld_frame1time) = upper.y;
}
}
field = GetMonsterSoundSampleField(argv(0));
if(GetMonsterSoundSampleField_notFound)
continue;
- if(self.field)
- strunzone(self.field);
- self.field = strzone(strcat(argv(1), " ", argv(2)));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
return 1;
if(delaytoo)
if(time < self.msound_delay)
return; // too early
- GlobalSound(self.samplefield, chan, VOICETYPE_PLAYERSOUND);
+ GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
self.msound_delay = time + sound_delay;
}
entity e;
e = start;
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
funcPost(pass, e);
while(e != start)
{
- if(e.right)
+ if (e.(right))
{
- e = e.right;
+ e = e.(right);
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
}
else
- e = e.up;
+ e = e.(up);
funcPost(pass, e);
}
}
// start with a 1-element queue
queue_start = queue_end = e;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
// for each queued item:
- for (; queue_start; queue_start = queue_start.fld)
+ for (; queue_start; queue_start = queue_start.(fld))
{
// find all neighbors of queue_start
entity t;
if(iscon(t, queue_start, pass))
{
// it is connected? ADD IT. It will look for neighbors soon too.
- queue_end.fld = t;
+ queue_end.(fld) = t;
queue_end = t;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
}
}
}
// unmark
- for(queue_start = e; queue_start; queue_start = queue_start.fld)
+ for (queue_start = e; queue_start; queue_start = queue_start.(fld))
queue_start.FindConnectedComponent_processing = 0;
}
float d;
for(e = me.firstChild; e; e = e.nextSibling)
{
- o = e.originField;
- s = e.sizeField;
- me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+ o = e.(originField);
+ s = e.(sizeField);
+ me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
me.leaveSubitem(me);
}
{
e.resized = 0;
d = 1;
- o = e.originField;
- s = e.sizeField;
- me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+ o = e.(originField);
+ s = e.(sizeField);
+ me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
me.leaveSubitem(me);
}
void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
{
- if(weight == 0)
+ if (weight == 0)
return;
- if(mean == 0)
- e.a *= pow(value, weight);
+ if (mean == 0)
+ e.(a) *= pow(value, weight);
else
- e.a += pow(value, mean) * weight;
- e.c += weight;
+ e.(a) += pow(value, mean) * weight;
+ e.(c) += weight;
}
float mean_evaluate(entity e, .float a, .float c, float mean)
{
- if(e.c == 0)
+ if (e.(c) == 0)
return 0;
- if(mean == 0)
- return pow(e.a, 1.0 / e.c);
+ if (mean == 0)
+ return pow(e.(a), 1.0 / e.(c));
else
- return pow(e.a / e.c, 1.0 / mean);
+ return pow(e.(a) / e.(c), 1.0 / mean);
}
#define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)
w = find(w, classname, "waypoint");
}
- waypoint_schedulerelink(p.fld = waypoint_spawn(v, v, f));
+ waypoint_schedulerelink(p.(fld) = waypoint_spawn(v, v, f));
return 1;
}
if(navigation_waypoint_will_link(w.origin, porg, p, walkfromwp, 1050))
{
bestdist = d;
- p.fld = w;
+ p.(fld) = w;
}
}
w = find(w, classname, "waypoint");
}
if(bestdist < maxdist)
{
- print("update chain to new nearest WP ", etos(p.fld), "\n");
+ print("update chain to new nearest WP ", etos(p.(fld)), "\n");
return 0;
}
// we know maxdist < 2100
// so wp -> porg is still valid
// all is good
- p.fld = wp;
+ p.(fld) = wp;
return 0;
}
setorigin(p, save);
if(w)
{
- p.fld = w;
+ p.(fld) = w;
return 0;
}
}
.entity botframe_autowaypoints_lastwp0, botframe_autowaypoints_lastwp1;
void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
{
- float r;
- r = botframe_autowaypoints_fix_from(p, walkfromwp, p.fld, fld);
+ float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld);
if(r != -1)
return;
r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld);
flood = 2;
}
- if(time >= source.flood_field)
+ if (time >= source.(flood_field))
{
- source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + lines * flood_spl;
+ source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + lines * flood_spl;
}
else
{
}
else
{
- if(time >= source.flood_field)
- source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + flood_spl;
+ if (time >= source.(flood_field))
+ source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + flood_spl;
else
flood = 1;
}
if (timeout_status == TIMEOUT_ACTIVE) // when game is paused, no flood protection
- source.flood_field = flood = 0;
+ source.(flood_field) = flood = 0;
}
if(flood == 2) // cannot happen for empty msgstr
}
else if(flood == 1)
{
- if(autocvar_g_chat_flood_notify_flooder)
+ if (autocvar_g_chat_flood_notify_flooder)
{
- sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n"));
+ sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.(flood_field) - time), "^3 seconds\n"));
ret = 0;
}
else
field = GetVoiceMessageSampleField(argv(0));
if(GetPlayerSoundSampleField_notFound)
continue;
- if(self.field)
- strunzone(self.field);
- self.field = strzone(strcat(argv(1), " ", argv(2)));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
return 1;
void PlayerSound(.string samplefield, float chan, float voicetype)
{
- GlobalSound(self.samplefield, chan, voicetype);
+ GlobalSound(self.(samplefield), chan, voicetype);
}
void VoiceMessage(string type, string msg)
flood = Say(self, ownteam, world, msg, 1);
- if(IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
- FakeGlobalSound(self.sample, CH_VOICE, voicetype);
+ if (IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
+ FakeGlobalSound(self.(sample), CH_VOICE, voicetype);
else if (flood > 0)
- GlobalSound(self.sample, CH_VOICE, voicetype);
+ GlobalSound(self.(sample), CH_VOICE, voicetype);
}
void MoveToTeam(entity client, float team_colour, float type)
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
{
entity head;
FOR_EACH_PLAYER(head)
- head.winning = (head.field == value);
+ head.winning = (head.(field) == value);
}
// set the .winning flag for those players with a given field value
{
entity head;
FOR_EACH_PLAYER(head)
- if(head.field == value)
+ if (head.(field) == value)
head.winning = 1;
}
{
if (f < 0)
{
- if (self.field)
- strunzone(self.field);
- self.field = string_null;
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = string_null;
}
else if (f > 0)
{
if (thisname == name)
{
- if (self.field)
- strunzone(self.field);
- self.field = strzone(argv(f + 1));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(argv(f + 1));
}
}
else
if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
if (thisname == name)
{
- string s;
- s = func(strcat1(self.field));
- if (s != self.field)
+ string s = func(strcat1(self.(field)));
+ if (s != self.(field))
{
- strunzone(self.field);
- self.field = strzone(s);
+ strunzone(self.(field));
+ self.(field) = strzone(s);
}
}
}
else if (f > 0)
{
if (thisname == name)
- self.field = stof(argv(f + 1));
+ self.(field) = stof(argv(f + 1));
}
else
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
{
if (thisname == name)
{
- if(!self.field)
+ if (!self.(field))
{
- self.field = stof(argv(f + 1));
- if(!self.field)
- self.field = -1;
+ self.(field) = stof(argv(f + 1));
+ if (!self.(field))
+ self.(field) = -1;
}
}
}
else
{
- if(!self.field)
+ if (!self.(field))
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
}
void playerdemo_write_originvector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_sizevector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_vector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_string(.string f, string name)
{
- fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+ fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
}
void playerdemo_write_modelstring(.string f, string name)
{
- fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+ fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
}
void playerdemo_write_float(.float f, string name)
{
- fputs(self.playerdemo_fh, strcat(ftos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(ftos(self.(f)), "\n"));
}
void playerdemo_write()
{
}
void playerdemo_read_sizevector(.vector f, string name)
{
- self.f = stov(fgets(self.playerdemo_fh));
+ self.(f) = stov(fgets(self.playerdemo_fh));
setsize(self, self.mins, self.maxs);
}
void playerdemo_read_vector(.vector f, string name)
{
- self.f = stov(fgets(self.playerdemo_fh));
+ self.(f) = stov(fgets(self.playerdemo_fh));
}
void playerdemo_read_string(.string f, string name)
{
- string s;
- s = fgets(self.playerdemo_fh);
- if(s != self.f)
+ string s = fgets(self.playerdemo_fh);
+ if (s != self.(f))
{
/*
if(self.f)
strunzone(self.f);
*/
- self.f = strzone(s);
+ self.(f) = strzone(s);
}
}
void playerdemo_read_modelstring(.string f, string name)
{
- string s;
- s = fgets(self.playerdemo_fh);
- if(s != self.f)
+ string s = fgets(self.playerdemo_fh);
+ if (s != self.(f))
setmodel(self, s);
}
void playerdemo_read_float(.float f, string name)
{
- self.f = stof(fgets(self.playerdemo_fh));
+ self.(f) = stof(fgets(self.playerdemo_fh));
}
float playerdemo_read()
{
return previous;
if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
return previous;
- if(t1.field == t2.field)
+ if (t1.(field) == t2.(field))
return previous;
previous.y = fieldflags & SFL_SORT_PRIO_MASK;
if(fieldflags & SFL_ZERO_IS_WORST)
{
- if(t1.field == 0)
+ if (t1.(field) == 0)
{
previous.x = -1;
return previous;
}
- else if(t2.field == 0)
+ else if (t2.(field) == 0)
{
previous.x = +1;
return previous;
}
}
- if(fieldflags & SFL_LOWER_IS_BETTER)
- previous.x = (t2.field - t1.field);
+ if (fieldflags & SFL_LOWER_IS_BETTER)
+ previous.x = (t2.(field) - t1.(field));
else
- previous.x = (t1.field - t2.field);
+ previous.x = (t1.(field) - t2.(field));
return previous;
}
plist = world;
FOR_EACH_CLIENT(p)
- p.field = 0;
+ p.(field) = 0;
FOR_EACH_CLIENT(p) if(p.scorekeeper)
{
if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
j = i;
- pbest.field = j;
+ pbest.(field) = j;
if (!pfirst)
pfirst = pbest;
float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
{
- if (!item.ammotype)
+ if (!item.(ammotype))
return false;
if (item.spawnshieldtime)
{
- if ((player.ammotype < ammomax) || item.pickup_anyway)
+ if ((player.(ammotype) < ammomax) || item.pickup_anyway)
{
- player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype);
+ player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype));
goto YEAH;
}
}
else if(g_weapon_stay == 2)
{
- float mi = min(item.ammotype, ammomax);
- if (player.ammotype < mi)
+ float mi = min(item.(ammotype), ammomax);
+ if (player.(ammotype) < mi)
{
- player.ammotype = mi;
+ player.(ammotype) = mi;
goto YEAH;
}
}
float GiveBit(entity e, .float fld, float bit, float op, float val)
{
float v0, v1;
- v0 = (e.fld & bit);
+ v0 = (e.(fld) & bit);
switch(op)
{
case OP_SET:
if(val > 0)
- e.fld |= bit;
+ e.(fld) |= bit;
else
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
case OP_MIN:
case OP_PLUS:
if(val > 0)
- e.fld |= bit;
+ e.(fld) |= bit;
break;
case OP_MAX:
if(val <= 0)
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
case OP_MINUS:
if(val > 0)
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
}
- v1 = (e.fld & bit);
+ v1 = (e.(fld) & bit);
return (v0 != v1);
}
float GiveValue(entity e, .float fld, float op, float val)
{
float v0, v1;
- v0 = e.fld;
+ v0 = e.(fld);
switch(op)
{
case OP_SET:
- e.fld = val;
+ e.(fld) = val;
break;
case OP_MIN:
- e.fld = max(e.fld, val); // min 100 cells = at least 100 cells
+ e.(fld) = max(e.(fld), val); // min 100 cells = at least 100 cells
break;
case OP_MAX:
- e.fld = min(e.fld, val);
+ e.(fld) = min(e.(fld), val);
break;
case OP_PLUS:
- e.fld += val;
+ e.(fld) += val;
break;
case OP_MINUS:
- e.fld -= val;
+ e.(fld) -= val;
break;
}
- v1 = e.fld;
+ v1 = e.(fld);
return (v0 != v1);
}
void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime)
{
if(v0 < v1)
- e.rotfield = max(e.rotfield, time + rottime);
+ e.(rotfield) = max(e.(rotfield), time + rottime);
else if(v0 > v1)
- e.regenfield = max(e.regenfield, time + regentime);
+ e.(regenfield) = max(e.(regenfield), time + regentime);
}
float GiveItems(entity e, float beginarg, float endarg)
{
void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
{
- if(self.regen_field < field_max)
- if(timer + rpause < time)
+ if (self.(regen_field) < field_max)
+ if (timer + rpause < time)
{
- if(_healthscale)
+ if (_healthscale)
regen = regen * (self.vehicle_health / self.tur_health);
- self.regen_field = min(self.regen_field + regen * delta_time, field_max);
+ self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max);
- if(self.owner)
- self.owner.regen_field = (self.regen_field / field_max) * 100;
+ if (self.owner)
+ self.owner.(regen_field) = (self.(regen_field) / field_max) * 100;
}
}
const float VHSF_FACTORY = 2;
.void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
.float(float _imp) vehicles_impulse;
-.float vehicle_weapon2mode = volly_counter;
+.float vehicle_weapon2mode;
#ifdef VEHICLES_USE_ODE
void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
wp.team = t;
wp.owner = own;
wp.currentammo = hideable;
- if(own)
+ if (own)
{
- if(own.ownfield)
- remove(own.ownfield);
- own.ownfield = wp;
+ if (own.(ownfield))
+ remove(own.(ownfield));
+ own.(ownfield) = wp;
wp.owned_by_field = ownfield;
}
wp.fade_rate = maxdistance;
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammotype += self.(weapon_load[self.weapon]);
+ own.(ammotype) += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- wep.ammotype = 0;
+ wep.(ammotype) = 0;
}
else if(doreduce)
{
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammotype += self.(weapon_load[self.weapon]);
+ own.(ammotype) += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- thisammo = min(own.ammotype, wep.ammotype);
- wep.ammotype = thisammo;
- own.ammotype -= thisammo;
+ thisammo = min(own.(ammotype), wep.(ammotype));
+ wep.(ammotype) = thisammo;
+ own.(ammotype) -= thisammo;
switch(ammotype)
{