WriteByte(channel, is_pure(this));
vector o = this.origin;
if (o == '0 0 0') // brushes
- o = (this.absmin + this.absmax) / 2;
+ o = (this.absmin + this.absmax) * 0.5;
if (this.tag_entity)
o += this.tag_entity.origin;
WriteVector(channel, o);
if(!n)
return;
- havocbot_middlepoint = s / n;
+ // TODO: Consider changing this back to `s / n` after https://github.com/graphitemaster/gmqcc/issues/210.
+ havocbot_middlepoint = s * (1 / n);
havocbot_middlepoint_radius = vlen(fo - havocbot_middlepoint);
havocbot_symmetry_axis_m = 0;
setsize(tracetest_ent, PL_MIN_CONST, PL_MAX_CONST);
tracetest_ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
- vector top_min = (this.absmin + this.absmax) / 2;
+ vector top_min = (this.absmin + this.absmax) * 0.5;
top_min.z = this.absmax.z;
vector top_max = top_min;
top_max.z += PL_MAX_CONST.z - PL_MIN_CONST.z;
tracetoss(tracetest_ent, tracetest_ent);
if (trace_startsolid && ofs.z)
{
- setorigin(tracetest_ent, targ.origin + ofs / 2);
+ setorigin(tracetest_ent, targ.origin + ofs * 0.5);
tracetoss(tracetest_ent, tracetest_ent);
if (trace_startsolid && ofs.z)
{
setorigin(e, e.origin);
float model_radius = e.maxs.x;
- vector size = '1 1 1' * e.orb_radius / 2;
+ vector size = '.5 .5 .5' * e.orb_radius;
setsize(e,-size,size);
e.orb_radius = e.orb_radius/model_radius*0.6;
setmodel(orb, MDL_NADE_ORB);
orb.skin = 1;
orb.orb_radius = orb_rad; // required for fading
- vector size = '1 1 1' * orb.orb_radius / 2;
+ vector size = '.5 .5 .5' * orb.orb_radius;
setsize(orb, -size, size);
Net_LinkEntity(orb, true, 0, orb_send);
if (v.y & BIT(7)) { v.y &= ~BIT(7); v.x *= -1; }
if (v.y & BIT(6)) { v.y &= ~BIT(6); v.y *= -1; }
if (v.z & BIT(6)) { v.z &= ~BIT(6); v.z *= -1; }
- return v / 2;
+ return v * 0.5;
}
#ifdef GAMEQC
float max_allowed_segments = ARC_MAX_SEGMENTS;
if(WEP_CVAR(WEP_ARC, beam_distancepersegment))
{
- max_allowed_segments = 1 + (vlen(w_shotdir / WEP_CVAR(WEP_ARC, beam_distancepersegment)));
+ max_allowed_segments = 1 + vlen(w_shotdir) / WEP_CVAR(WEP_ARC, beam_distancepersegment);
max_allowed_segments = bound(1, max_allowed_segments, ARC_MAX_SEGMENTS);
}
setorigin(tracetossfaketarget, v);
c = 0;
- dir = (end - org) / shotdistance; // same as dir = normalize(end - org); but cheaper
+ // TODO: Consider changing this back to `/ shotdistance` after https://github.com/graphitemaster/gmqcc/issues/210.
+ dir = (end - org) * (1 / shotdistance); // same as dir = normalize(end - org); but cheaper
vector test_dir = dir;
vector test_dir_normalized = dir;
while (c < 10) // 10 traces
+ 0.05 / max(1, sk + this.havocbot_keyboardskill)
+ random() * 0.025 / max(0.00025, skill + this.havocbot_keyboardskill)
, time);
- vector keyboard = CS(this).movement / autocvar_sv_maxspeed;
+ // TODO: Consider changing this back to `/ autocvar_sv_maxspeed` after https://github.com/graphitemaster/gmqcc/issues/210.
+ vector keyboard = CS(this).movement * (1 / autocvar_sv_maxspeed);
float trigger = autocvar_bot_ai_keyboard_threshold;
}
else
{
- jump_height = stepheightvec + jumpheight_vec / 2;
+ jump_height = stepheightvec + jumpheight_vec * 0.5;
tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this);
if (trace_fraction > s)
{
{
vector v1 = stov(argv(arg_idx++));
vector v2 = stov(argv(arg_idx++));
- vector mid = (v1 + v2) / 2;
+ vector mid = (v1 + v2) * 0.5;
float diffy = (v2.y - v1.y);
float diffx = (v2.x - v1.x);
else
{
vector v1, v2, v3, v4, v5, v6;
+ // TODO: Consider inlining this away after https://github.com/graphitemaster/gmqcc/issues/210.
+ float r_ctf_flags = 1 / ctf_flags;
for (int i = 1; i <= ctf_flags; ++i)
{
- if (i == 1) { v1 = stov(argv(arg_idx++)); org = v1 / ctf_flags; }
- else if (i == 2) { v2 = stov(argv(arg_idx++)); org += v2 / ctf_flags; }
- else if (i == 3) { v3 = stov(argv(arg_idx++)); org += v3 / ctf_flags; }
- else if (i == 4) { v4 = stov(argv(arg_idx++)); org += v4 / ctf_flags; }
- else if (i == 5) { v5 = stov(argv(arg_idx++)); org += v5 / ctf_flags; }
- else if (i == 6) { v6 = stov(argv(arg_idx++)); org += v6 / ctf_flags; }
+ if (i == 1) { v1 = stov(argv(arg_idx++)); org = v1 * r_ctf_flags; }
+ else if (i == 2) { v2 = stov(argv(arg_idx++)); org += v2 * r_ctf_flags; }
+ else if (i == 3) { v3 = stov(argv(arg_idx++)); org += v3 * r_ctf_flags; }
+ else if (i == 4) { v4 = stov(argv(arg_idx++)); org += v4 * r_ctf_flags; }
+ else if (i == 5) { v5 = stov(argv(arg_idx++)); org += v5 * r_ctf_flags; }
+ else if (i == 6) { v6 = stov(argv(arg_idx++)); org += v6 * r_ctf_flags; }
}
}
vector dir = this.origin - myorg;
dist = vlen(dir);
- dir = (dist ? dir / dist : '0 0 0'); // same as dir = normalize(dir); but cheaper
+
+ // TODO: Consider changing this back to `dir / dist` after https://github.com/graphitemaster/gmqcc/issues/210.
+ dir = (dist ? dir * (1 / dist) : '0 0 0'); // same as dir = normalize(dir); but cheaper
if(tarzan)
{