void waypoint_spawnforitem_force(entity e, vector org);
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent);
void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent);
-void waypoint_spawn_fromeditor(entity pl);
+void waypoint_spawn_fromeditor(entity pl, bool at_crosshair);
entity waypoint_spawn(vector m1, vector m2, float f);
void waypoint_unreachable(entity pl);
return w;
}
-void waypoint_spawn_fromeditor(entity pl)
+void waypoint_spawn_fromeditor(entity pl, bool at_crosshair)
{
entity e;
vector org = pl.origin;
+ if (at_crosshair)
+ {
+ crosshair_trace(pl);
+ org = trace_endpos - eZ * STAT(PL_MIN, pl).z;
+ }
int ctf_flags = havocbot_symmetry_origin_order;
bool sym = ((autocvar_g_waypointeditor_symmetrical > 0 && ctf_flags >= 2)
|| (autocvar_g_waypointeditor_symmetrical < 0));
ctf_flags = 2;
int wp_num = ctf_flags;
- if(!PHYS_INPUT_BUTTON_CROUCH(pl))
+ if(!PHYS_INPUT_BUTTON_CROUCH(pl) && !at_crosshair)
{
// snap waypoint to item's origin if close enough
IL_EACH(g_items, true,
#define waypoint_remove_links_hardwired() waypoint_load_or_remove_links_hardwired(true)
void waypoint_load_or_remove_links_hardwired(bool removal_mode);
-void waypoint_spawn_fromeditor(entity pl);
+void waypoint_spawn_fromeditor(entity pl, bool at_crosshair);
entity waypoint_spawn(vector m1, vector m2, float f);
entity waypoint_spawnpersonal(entity this, vector position);
void waypoint_spawnforitem_force(entity e, vector org) { }
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent) { }
void waypoint_spawnforteleporter_wz(entity e, entity tracetest_ent) { }
-void waypoint_spawn_fromeditor(entity pl) { }
+void waypoint_spawn_fromeditor(entity pl, bool at_crosshair) { }
entity waypoint_spawn(vector m1, vector m2, float f) { return NULL; }
#endif
if (!IS_PLAYER(caller))
sprint(caller, "ERROR: this command works only if you are player\n");
else
- waypoint_spawn_fromeditor(caller);
+ waypoint_spawn_fromeditor(caller, (argv(2) == "crosshair"));
return;
}
else if (argv(1) == "remove")