From: terencehill Date: Thu, 3 Aug 2017 13:57:18 +0000 (+0200) Subject: Fix player spawn points not linked from/to any waypoint when there's a very low ceili... X-Git-Tag: xonotic-v0.8.5~2378^2~95 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6af15326304c1160f8828a9ea2971cef45ecb30a;p=xonotic%2Fxonotic-data.pk3dir.git Fix player spawn points not linked from/to any waypoint when there's a very low ceiling or obstruction; it fixes spawn point near mega armor in Boil --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 453b0930c..72a90104a 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -745,8 +745,12 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom return it; }); - vector org = ent.origin + 0.5 * (ent.mins + ent.maxs); - org.z = ent.origin.z + ent.mins.z - PL_MIN_CONST.z; // player height + vector org = ent.origin; + if(ent.size) + { + org += 0.5 * (ent.mins + ent.maxs); + org.z = ent.origin.z + ent.mins.z - PL_MIN_CONST.z; // player height + } // TODO possibly make other code have the same support for bboxes if(ent.tag_entity) org = org + ent.tag_entity.origin;