+
+ if (vehicle_impulse(this, imp)) return;
+
+ if (CheatImpulse(imp)) return;
+
+ FOREACH(IMPULSES, it.impulse == imp, {
+ void(entity) f = it.impulse_handle;
+ if (!f) continue;
+ f(this);
+ return;
+ });
+}
+
+IMPULSE(use)
+{
+ PlayerUseKey();
+}
+
+IMPULSE(waypoint_personal_here)
+{
+ entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this.origin, RADARICON_WAYPOINT);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "personal waypoint spawned at location\n");
+}
+
+IMPULSE(waypoint_personal_crosshair)
+{
+ WarpZone_crosshair_trace(this);
+ entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, trace_endpos, RADARICON_WAYPOINT);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "personal waypoint spawned at crosshair\n");
+}
+
+IMPULSE(waypoint_personal_death)
+{
+ if (!this.death_origin) return;
+ entity wp = WaypointSprite_DeployPersonal(WP_Waypoint, this.death_origin, RADARICON_WAYPOINT);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "personal waypoint spawned at death location\n");
+}
+
+IMPULSE(waypoint_here_follow)
+{
+ if (!teamplay) return;
+ if (IS_DEAD(this)) return;
+ if (!MUTATOR_CALLHOOK(HelpMePing, this))
+ {
+ entity wp = WaypointSprite_Attach(WP_Helpme, true, RADARICON_HELPME);
+ if (!wp) WaypointSprite_HelpMePing(this.waypointsprite_attachedforcarrier);
+ else WaypointSprite_Ping(wp);
+ }
+ sprint(this, "HELP ME attached\n");
+}
+
+IMPULSE(waypoint_here_here)
+{
+ entity wp = WaypointSprite_DeployFixed(WP_Here, false, this.origin, RADARICON_HERE);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "HERE spawned at location\n");
+}
+
+IMPULSE(waypoint_here_crosshair)
+{
+ WarpZone_crosshair_trace(this);
+ entity wp = WaypointSprite_DeployFixed(WP_Here, false, trace_endpos, RADARICON_HERE);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "HERE spawned at crosshair\n");
+}
+
+IMPULSE(waypoint_here_death)
+{
+ if (!this.death_origin) return;
+ entity wp = WaypointSprite_DeployFixed(WP_Here, false, this.death_origin, RADARICON_HERE);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "HERE spawned at death location\n");
+}
+
+IMPULSE(waypoint_danger_here)
+{
+ entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this.origin, RADARICON_DANGER);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "DANGER spawned at location\n");
+}
+
+IMPULSE(waypoint_danger_crosshair)
+{
+ WarpZone_crosshair_trace(this);
+ entity wp = WaypointSprite_DeployFixed(WP_Danger, false, trace_endpos, RADARICON_DANGER);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "DANGER spawned at crosshair\n");
+}
+
+IMPULSE(waypoint_danger_death)
+{
+ if (!this.death_origin) return;
+ entity wp = WaypointSprite_DeployFixed(WP_Danger, false, this.death_origin, RADARICON_DANGER);
+ if (wp) WaypointSprite_Ping(wp);
+ sprint(this, "DANGER spawned at death location\n");
+}
+
+IMPULSE(waypoint_clear_personal)
+{
+ WaypointSprite_ClearPersonal();
+ if (this.personal)
+ {
+ remove(this.personal);
+ this.personal = NULL;
+ }
+ sprint(this, "personal waypoint cleared\n");
+}
+
+IMPULSE(waypoint_clear)
+{
+ WaypointSprite_ClearOwned();
+ if (this.personal)
+ {
+ remove(this.personal);
+ this.personal = NULL;
+ }
+ sprint(this, "all waypoints cleared\n");
+}
+
+IMPULSE(navwaypoint_spawn)
+{
+ if (!autocvar_g_waypointeditor) return;
+ waypoint_schedulerelink(waypoint_spawn(this.origin, this.origin, 0));
+ bprint(strcat("Waypoint spawned at ", vtos(this.origin), "\n"));
+}
+
+IMPULSE(navwaypoint_remove)
+{
+ if (!autocvar_g_waypointeditor) return;
+ entity e = navigation_findnearestwaypoint(this, false);
+ if (!e) return;
+ if (e.wpflags & WAYPOINTFLAG_GENERATED) return;
+ bprint(strcat("Waypoint removed at ", vtos(e.origin), "\n"));
+ waypoint_remove(e);
+}
+
+IMPULSE(navwaypoint_relink)
+{
+ if (!autocvar_g_waypointeditor) return;
+ waypoint_schedulerelinkall();
+}
+
+IMPULSE(navwaypoint_save)
+{
+ if (!autocvar_g_waypointeditor) return;
+ waypoint_saveall();
+}
+
+IMPULSE(navwaypoint_unreachable)
+{
+ if (!autocvar_g_waypointeditor) return;
+ for (entity e = findchain(classname, "waypoint"); e; e = e.chain)