if(!sound_allowed(MSG_BROADCAST, dmgowner))
deathtype |= 0x8000;
- e = new(damageinfo);
- setorigin(e, org);
+ e = new_pure(damageinfo);
+ // origin is just data to be sent
+ //setorigin(e, org);
+ e.origin = org;
e.projectiledeathtype = deathtype;
e.dmg = coredamage;
e.dmg_edge = edgedamage;
if(g_cts) // no gibs in CTS
return;
- entity e = new(gibsplash);
+ entity e = new_pure(gibsplash);
e.cnt = amount;
e.state = type; // should stay smaller than 15
if(!sound_allowed(MSG_BROADCAST, gibowner) || !sound_allowed(MSG_BROADCAST, attacker))
else
e.team = etof(gibowner);
- setorigin(e, org);
+ // origin is just data to be sent
+ //setorigin(e, org);
+ e.origin = org;
e.velocity = dir;
e.oldorigin_x = compressShortVector(e.velocity);
case "weaponentity":
case "exteriorweaponentity":
case "sprite_waypoint":
- case "waypoint":
- case "gibsplash":
- case "damageinfo":
case "spawnfunc":
case "weaponchild":
case "chatbubbleentity":
localcmd("quit\n");
}
- if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
+ if (currentbots > 0 || waypointeditor_enabled || autocvar_g_waypointeditor_auto)
if (botframe_spawnedwaypoints)
{
if(botframe_cachedwaypointlinks)
}
}
- if (autocvar_g_waypointeditor)
+ if (waypointeditor_enabled)
botframe_showwaypointlinks();
if (autocvar_g_waypointeditor_auto)
vector pm1 = ent.origin + ent.mins;
vector pm2 = ent.origin + ent.maxs;
- if (autocvar_g_waypointeditor && !IS_BOT_CLIENT(ent))
+ if (waypointeditor_enabled && !IS_BOT_CLIENT(ent))
{
// this code allows removing waypoints in the air and seeing jumppad/telepport waypoint links
// FIXME it causes a bug where a waypoint spawned really close to another one (max 16 qu)
}
else
{
- if(autocvar_g_waypointeditor && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout)
+ if(waypointeditor_enabled && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout)
e.nearestwaypoint = NULL;
if ((!e.nearestwaypoint || e.navigation_dynamicgoal)
if(e.navigation_dynamicgoal)
e.nearestwaypointtimeout = time + 2;
- else if(autocvar_g_waypointeditor)
+ else if(waypointeditor_enabled)
e.nearestwaypointtimeout = time + 3 + random() * 2;
}
nwp = e.nearestwaypoint;
if(nearest_wp && nearest_wp.enemy && !(nearest_wp.enemy.wpflags & WPFLAGMASK_NORELINK))
{
// often path can be optimized by not adding the nearest waypoint
- if (this.goalentity.navigation_dynamicgoal || autocvar_g_waypointeditor)
+ if (this.goalentity.navigation_dynamicgoal || waypointeditor_enabled)
{
if (nearest_wp.enemy.wpcost < autocvar_bot_ai_strategyinterval_movingtarget)
{
#include <server/spawnpoints.qh>
#include <server/weapons/tracing.qh>
+STATIC_INIT(waypoints)
+{
+ waypointeditor_enabled = autocvar_g_waypointeditor;
+}
.entity spawnpointmodel;
void waypoint_unreachable(entity pl)
{
void waypoint_setupmodel(entity wp)
{
- if (autocvar_g_waypointeditor)
+ if (waypointeditor_enabled)
{
// TODO: add some sort of visible box in edit mode for box waypoints
vector m1 = wp.mins;
w.wpflags = f;
w.solid = SOLID_TRIGGER;
w.createdtime = time;
- setorigin(w, (m1 + m2) * 0.5);
+ w.origin = (m1 + m2) * 0.5;
+ if (waypointeditor_enabled)
+ setorigin(w, w.origin);
+ else // don't link into the world, only bots are aware of waypoints
+ make_pure(w);
setsize(w, m1 - w.origin, m2 - w.origin);
if (w.size)
w.wpisbox = true;
{
IL_PUSH(g_waypoints, this);
- setorigin(this, this.origin);
+ if (waypointeditor_enabled)
+ setorigin(this, this.origin);
+ else
+ make_pure(this);
// schedule a relink after other waypoints have had a chance to spawn
waypoint_clearlinks(this);
//waypoint_schedulerelink(this);
waypoint_version_loaded = ver;
LOG_TRACE("loaded ", ftos(cwp), " waypoints and ", ftos(cwb), " wayboxes from maps/", mapname, ".waypoints");
- if (autocvar_g_waypointeditor && autocvar_g_waypointeditor_symmetrical_allowload)
+ if (waypointeditor_enabled && autocvar_g_waypointeditor_symmetrical_allowload)
{
string sym_str = "";
cvar_set("g_waypointeditor_symmetrical", ftos(sym));
#pragma once
+bool waypointeditor_enabled;
+
bool autocvar_g_waypointeditor;
bool autocvar_g_waypointeditor_symmetrical;
bool autocvar_g_waypointeditor_symmetrical_allowload = true;
{
case CMD_REQUEST_COMMAND:
{
- if (!autocvar_g_waypointeditor)
+ if (!waypointeditor_enabled)
{
sprint(caller, "ERROR: this command works only if the waypoint editor is on\n");
return;