]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/navigation.qh
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / navigation.qh
index 4731e67babc016531af00b91e5592d761dad5832..ea913456d33eac5db852b53c339a80d95b89350f 100644 (file)
@@ -49,14 +49,13 @@ entity navigation_bestgoal;
        waypoint_addlink_customcost(to_item, from_wp, waypoint_getlinkcost(from_wp, to_item))
 
 // if ent is a box waypoint or an item v is set to coords of ent that are closer to org
-// (but v.z is set to the middle coord of ent)
 #define SET_DESTCOORDS(ent, org, v) MACRO_BEGIN { \
        if ((ent.classname != "waypoint") || ent.wpisbox) { \
                vector wm1 = ent.origin + ent.mins; \
                vector wm2 = ent.origin + ent.maxs; \
                v.x = bound(wm1.x, org.x, wm2.x); \
                v.y = bound(wm1.y, org.y, wm2.y); \
-               v.z = (wm2.z - wm1.z) / 2; \
+               v.z = bound(wm1.z, org.z, wm2.z); \
        } else { \
                v = ent.origin; \
        } \
@@ -125,6 +124,12 @@ void navigation_dynamicgoal_init(entity this, bool initially_static);
 void navigation_dynamicgoal_set(entity this);
 void navigation_dynamicgoal_unset(entity this);
 
+.int nav_submerged_state;
+#define SUBMERGED_UNDEFINED 0
+#define SUBMERGED_NO 1
+#define SUBMERGED_YES 2
+bool navigation_check_submerged_state(entity ent, vector pos);
+
 
 /*
  * Functions
@@ -156,4 +161,4 @@ void navigation_unstuck(entity this);
 void botframe_updatedangerousobjects(float maxupdate);
 
 entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
-float navigation_waypoint_will_link(vector v, vector org, entity ent, vector v2, float v2_height, float walkfromwp, float bestdist);
+float navigation_waypoint_will_link(vector v, vector org, entity ent, vector v2, float v2_height, vector o2, float o2_height, float walkfromwp, float bestdist);