if (jp)
{
e = NULL;
- IL_EACH(g_waypoints, it.wpflags & WPFLAGMASK_NORELINK
+ IL_EACH(g_waypoints, (it.wpflags & WPFLAGMASK_NORELINK)
&& boxesoverlap(org + PL_MIN_CONST, org + PL_MAX_CONST, it.absmin, it.absmax),
{
e = it; break;
entity start_wp = NULL;
if (start_wp_is_spawned)
{
- IL_EACH(g_waypoints, (start_wp_is_hardwired || it.wpflags & WPFLAGMASK_NORELINK)
+ IL_EACH(g_waypoints, (start_wp_is_hardwired || (it.wpflags & WPFLAGMASK_NORELINK))
&& boxesoverlap(start_org, start_org, it.absmin, it.absmax),
{
start_wp = it; break;
void waypoint_removelink(entity from, entity to)
{
- if (from == to || (from.wpflags & WPFLAGMASK_NORELINK && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))))
+ if (from == to || ((from.wpflags & WPFLAGMASK_NORELINK) && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))))
return;
entity fromwp31_prev = from.wp31;
if (submerged_from && submerged_to)
return waypoint_getlinearcost_underwater(vlen(to - from));
- if (from_ent.wpflags & WAYPOINTFLAG_CROUCH && to_ent.wpflags & WAYPOINTFLAG_CROUCH)
+ if ((from_ent.wpflags & WAYPOINTFLAG_CROUCH) && (to_ent.wpflags & WAYPOINTFLAG_CROUCH))
return waypoint_getlinearcost_crouched(vlen(to - from));
float c = waypoint_getlinearcost(vlen(to - from));
if(height > jumpheight_vec.z && autocvar_sv_gravity > 0)
{
float height_cost; // fall cost
- if (boolean(from_ent.wpflags & WAYPOINTFLAG_JUMP))
+ if (from_ent.wpflags & WAYPOINTFLAG_JUMP)
height_cost = jumpheight_time + sqrt((height + jumpheight_vec.z) / (autocvar_sv_gravity / 2));
else
height_cost = sqrt(height / (autocvar_sv_gravity / 2));
return (c + waypoint_getlinearcost_underwater(vlen(to - from))) / 2;
// consider half path crouched
- if (from_ent.wpflags & WAYPOINTFLAG_CROUCH || to_ent.wpflags & WAYPOINTFLAG_CROUCH)
+ if ((from_ent.wpflags & WAYPOINTFLAG_CROUCH) || (to_ent.wpflags & WAYPOINTFLAG_CROUCH))
return (c + waypoint_getlinearcost_crouched(vlen(to - from))) / 2;
return c;
vector m1 = PL_MIN_CONST;
vector m2 = PL_MAX_CONST;
- if (this.wpflags & WAYPOINTFLAG_CROUCH || it.wpflags & WAYPOINTFLAG_CROUCH)
+ if ((this.wpflags & WAYPOINTFLAG_CROUCH) || (it.wpflags & WAYPOINTFLAG_CROUCH))
{
m1 = PL_CROUCH_MIN_CONST;
m2 = PL_CROUCH_MAX_CONST;
// links from crouch wp to normal wp (and viceversa) are very short to avoid creating many links
// that would be wasted due to rough travel cost calculation (the longer link is, the higher cost is)
// links from crouch wp to crouch wp can be as long as normal links
- if (!(this.wpflags & WAYPOINTFLAG_CROUCH && it.wpflags & WAYPOINTFLAG_CROUCH))
+ if (!((this.wpflags & WAYPOINTFLAG_CROUCH) && (it.wpflags & WAYPOINTFLAG_CROUCH)))
maxdist = 100;
}
//traceline(this.origin, it.origin, false, NULL);
//if (trace_fraction == 1)
- if (this.wpisbox || this.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT) // forbid outgoing links
+ if (this.wpisbox || (this.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)) // forbid outgoing links
|| it.SUPPORT_WP) // forbid incoming links
{
relink_walkculled += 0.5;
}
// reverse direction
- if (it.wpisbox || it.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT) // forbid incoming links
+ if (it.wpisbox || (it.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)) // forbid incoming links
|| this.SUPPORT_WP) // forbid outgoing links
{
relink_walkculled += 0.5;
waypoint_addlink(wp_from, wp_to);
waypoint_mark_hardwiredlink(wp_from, wp_to);
} else if (wp_from.wpflags & WPFLAGMASK_NORELINK
- && (wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)
+ && ((wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))
|| (wp_from.wpisbox && wp_from.wpflags & WAYPOINTFLAG_TELEPORT)))
{
waypoint_addlink(wp_from, wp_to);
if (!s)
break;
fl = stof(s);
- if (fl & WAYPOINTFLAG_NORELINK__DEPRECATED)
- fl &= ~WAYPOINTFLAG_NORELINK__DEPRECATED;
+ fl &= ~WAYPOINTFLAG_NORELINK__DEPRECATED;
waypoint_spawn(m1, m2, fl);
if (m1 == m2)
cwp = cwp + 1;
if (!(wp1 && wp2))
return;
- if (waypoint_is_hardwiredlink(wp1, wp2) || wp1.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT | WAYPOINTFLAG_CUSTOM_JP))
+ if (waypoint_is_hardwiredlink(wp1, wp2) || (wp1.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT | WAYPOINTFLAG_CUSTOM_JP)))
te_beam(NULL, wp1.origin, wp2.origin);
else if (display_type == 1)
te_lightning2(NULL, wp1.origin, wp2.origin);