]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/waypoints.qc
Fix #2859 "Explosions do not go through warpzones"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / waypoints.qc
index 12bf39fa0c7d7fc348c549872b008279b7b7a2ed..d6bc1e6708eefcb4459cbe9eabeeb4b405ce380c 100644 (file)
@@ -1,5 +1,6 @@
 #include "waypoints.qh"
 
+#include <common/animdecide.qh>
 #include <common/constants.qh>
 #include <common/debug.qh>
 #include <common/gamemodes/_mod.qh>
 #include <server/spawnpoints.qh>
 #include <server/weapons/tracing.qh>
 
+STATIC_INIT(waypoints)
+{
+       waypointeditor_enabled = autocvar_g_waypointeditor;
+}
 .entity spawnpointmodel;
 void waypoint_unreachable(entity pl)
 {
@@ -88,11 +93,11 @@ void waypoint_unreachable(entity pl)
                        LOG_INFO("spawn without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
                        it.spawnpointmodel.effects |= EF_NODEPTHTEST;
                        _setmodel(it.spawnpointmodel, pl.model);
-                       it.spawnpointmodel.frame = pl.frame;
+                       it.spawnpointmodel.frame = ANIM_idle.m_id;
                        it.spawnpointmodel.skin = pl.skin;
-                       it.spawnpointmodel.colormap = pl.colormap;
-                       it.spawnpointmodel.colormod = pl.colormod;
-                       it.spawnpointmodel.glowmod = pl.glowmod;
+                       it.spawnpointmodel.colormap = 1024 + 68;
+                       it.spawnpointmodel.glowmod = '1 0 0';
+                       it.spawnpointmodel.angles = it.angles;
                        setsize(it.spawnpointmodel, PL_MIN_CONST, PL_MAX_CONST);
                        j++;
                }
@@ -354,7 +359,7 @@ void waypoint_restore_hardwiredlinks(entity wp)
 
 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;
@@ -1558,9 +1563,9 @@ void waypoint_load_hardwiredlinks()
                {
                        waypoint_addlink(wp_from, wp_to);
                        waypoint_mark_hardwiredlink(wp_from, wp_to);
-               } else if (wp_from.wpflags & WPFLAGMASK_NORELINK
+               } else if ((wp_from.wpflags & WPFLAGMASK_NORELINK)
                        && ((wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))
-                               || (wp_from.wpisbox && wp_from.wpflags & WAYPOINTFLAG_TELEPORT)))
+                               || (wp_from.wpisbox && (wp_from.wpflags & WAYPOINTFLAG_TELEPORT))))
                {
                        waypoint_addlink(wp_from, wp_to);
                }
@@ -1908,7 +1913,7 @@ float waypoint_loadall()
        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));