wp.colormod = '1 1 0'; // yellow
else if (wp.wpflags & WAYPOINTFLAG_SUPPORT)
wp.colormod = '0 1 0'; // green
- else if (wp.wpflags & WAYPOINTFLAG_NORELINK)
+ else if (wp.wpflags & WAYPOINTFLAG_CUSTOM_JP)
+ wp.colormod = '1 0.5 0'; // orange
+ else if (wp.wpflags & WAYPOINTFLAG_TELEPORT)
+ wp.colormod = '1 0.5 0'; // orange
+ else if (wp.wpflags & WAYPOINTFLAG_LADDER)
+ wp.colormod = '1 0.5 0'; // orange
+ else if (wp.wpflags & WAYPOINTFLAG_JUMP)
wp.colormod = '1 0.5 0'; // orange
else if (wp.wpflags & WAYPOINTFLAG_CROUCH)
wp.colormod = '0 1 1'; // cyan
// spawn only one destination waypoint for teleports teleporting player to the exact same spot
// otherwise links loaded from file would be applied only to the first destination
// waypoint since link format doesn't specify waypoint entities but just positions
- if((f & WAYPOINTFLAG_GENERATED) && !(f & (WAYPOINTFLAG_NORELINK | WAYPOINTFLAG_PERSONAL)) && m1 == m2)
+ if((f & WAYPOINTFLAG_GENERATED) && !(f & (WPFLAGMASK_NORELINK | WAYPOINTFLAG_PERSONAL)) && m1 == m2)
{
IL_EACH(g_waypoints, boxesoverlap(m1, m2, it.absmin, it.absmax),
{
void waypoint_start_hardwiredlink(entity pl)
{
entity wp = pl.nearestwaypoint;
- if ((!start_wp_is_spawned || start_wp_is_hardwired) && wp && !(wp.wpflags & WAYPOINTFLAG_NORELINK))
+ if ((!start_wp_is_spawned || start_wp_is_hardwired) && wp && !(wp.wpflags & WPFLAGMASK_NORELINK))
{
start_wp_is_hardwired = true;
start_wp_is_spawned = true;
if (jp)
{
e = NULL;
- IL_EACH(g_waypoints, it.wpflags & WAYPOINTFLAG_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;
});
if (!e)
- e = waypoint_spawn(jp.absmin - PL_MAX_CONST + '1 1 1', jp.absmax - PL_MIN_CONST + '-1 -1 -1', WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_NORELINK);
+ e = waypoint_spawn(jp.absmin - PL_MAX_CONST + '1 1 1', jp.absmax - PL_MIN_CONST + '-1 -1 -1', WAYPOINTFLAG_TELEPORT);
if (!pl.wp_locked)
pl.wp_locked = e;
}
LOG_INFOF("Error: can't spawn a %s waypoint over an existent waypoint of a different type\n", (is_jump_wp) ? "Jump" : "Support");
return;
}
- e = waypoint_spawn(org, org, type_flag | WAYPOINTFLAG_NORELINK);
+ e = waypoint_spawn(org, org, type_flag);
if (!pl.wp_locked)
pl.wp_locked = e;
}
entity start_wp = NULL;
if (start_wp_is_spawned)
{
- IL_EACH(g_waypoints, (start_wp_is_hardwired || it.wpflags & WAYPOINTFLAG_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 & WAYPOINTFLAG_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 (from == to || waypoint_islinked(from, to))
return;
- if (c == -1 && (from.wpflags & WAYPOINTFLAG_NORELINK) && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)))
+ if (c == -1 && (from.wpflags & WPFLAGMASK_NORELINK) && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)))
return;
if(c == -1)
void waypoint_addlink(entity from, entity to)
{
- if ((from.wpflags & WAYPOINTFLAG_NORELINK) && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)))
+ if ((from.wpflags & WPFLAGMASK_NORELINK) && !(from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)))
waypoint_addlink_for_custom_jumppad(from, to);
else
waypoint_addlink_customcost(from, to, -1);
{
if (boxesoverlap(this.absmin, this.absmax, it.absmin, it.absmax))
{
- if (!(this.wpflags & WAYPOINTFLAG_NORELINK))
+ if (!(this.wpflags & WPFLAGMASK_NORELINK))
waypoint_addlink(this, it);
- if (!(it.wpflags & WAYPOINTFLAG_NORELINK))
+ if (!(it.wpflags & WPFLAGMASK_NORELINK))
waypoint_addlink(it, this);
}
else
wp.enemy = NULL;
if (!(wp.wpflags & WAYPOINTFLAG_PERSONAL))
wp.owner = NULL;
- if (!(wp.wpflags & WAYPOINTFLAG_NORELINK))
+ if (!(wp.wpflags & WPFLAGMASK_NORELINK))
waypoint_clearlinks(wp);
// schedule an actual relink on next frame
setthink(wp, waypoint_think);
{
waypoint_addlink(wp_from, wp_to);
waypoint_mark_hardwiredlink(wp_from, wp_to);
- } else if (wp_from.wpflags & WAYPOINTFLAG_NORELINK
+ } else if (wp_from.wpflags & WPFLAGMASK_NORELINK
&& (wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT)
|| (wp_from.wpisbox && wp_from.wpflags & WAYPOINTFLAG_TELEPORT)))
{
float waypoint_loadall()
{
string s;
- float file, cwp, cwb, fl;
+ int file, cwp, cwb, fl;
vector m1, m2;
cwp = 0;
cwb = 0;
if (!s)
break;
fl = stof(s);
+ if (fl & WAYPOINTFLAG_NORELINK__DEPRECATED)
+ fl &= ~WAYPOINTFLAG_NORELINK__DEPRECATED;
waypoint_spawn(m1, m2, fl);
if (m1 == m2)
cwp = cwp + 1;
{
entity w;
entity dw;
- w = waypoint_spawn(org1, org2, WAYPOINTFLAG_GENERATED | teleport_flag | WAYPOINTFLAG_NORELINK);
+ w = waypoint_spawn(org1, org2, WAYPOINTFLAG_GENERATED | teleport_flag);
dw = waypoint_spawn(destination1, destination2, WAYPOINTFLAG_GENERATED);
// one way link to the destination
w.wp00_original = dw;
}
float bestdist = maxdist;
- IL_EACH(g_waypoints, it != wp && !(it.wpflags & WAYPOINTFLAG_NORELINK),
+ IL_EACH(g_waypoints, it != wp && !(it.wpflags & WPFLAGMASK_NORELINK),
{
float d = vlen(wp.origin - it.origin) + vlen(it.origin - porg);
if(d < bestdist)