nav: allow to disable player avoidance via yb_has_team_semiclip cvar (ref #478)
This commit is contained in:
parent
5fcfb3df40
commit
e753efd678
2 changed files with 9 additions and 3 deletions
|
|
@ -602,7 +602,7 @@ public:
|
||||||
public:
|
public:
|
||||||
template <typename T> T read () {
|
template <typename T> T read () {
|
||||||
T result {};
|
T result {};
|
||||||
auto size = sizeof (T);
|
constexpr auto size = sizeof (T);
|
||||||
|
|
||||||
if (m_cursor + size > m_buffer.length ()) {
|
if (m_cursor + size > m_buffer.length ()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -616,12 +616,12 @@ public:
|
||||||
|
|
||||||
// must be called right after read
|
// must be called right after read
|
||||||
template <typename T> void write (T value) {
|
template <typename T> void write (T value) {
|
||||||
auto size = sizeof (value);
|
constexpr auto size = sizeof (value);
|
||||||
memcpy (m_buffer.data () + m_cursor - size, &value, size);
|
memcpy (m_buffer.data () + m_cursor - size, &value, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> void skip () {
|
template <typename T> void skip () {
|
||||||
auto size = sizeof (T);
|
constexpr auto size = sizeof (T);
|
||||||
|
|
||||||
if (m_cursor + size > m_buffer.length ()) {
|
if (m_cursor + size > m_buffer.length ()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include <yapb.h>
|
#include <yapb.h>
|
||||||
|
|
||||||
|
ConVar cv_has_team_semiclip ("has_team_semiclip", "0", "When enabled, bots will not try to avoid teammates on their way. Assuming some of the semiclip plugins are in use.");
|
||||||
|
|
||||||
int Bot::findBestGoal () {
|
int Bot::findBestGoal () {
|
||||||
if (m_isCreature) {
|
if (m_isCreature) {
|
||||||
if (!graph.m_terrorPoints.empty ()) {
|
if (!graph.m_terrorPoints.empty ()) {
|
||||||
|
|
@ -422,6 +424,10 @@ void Bot::ignoreCollision () {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::doPlayerAvoidance (const Vector &normal) {
|
void Bot::doPlayerAvoidance (const Vector &normal) {
|
||||||
|
if (cv_has_team_semiclip.bool_ ()) {
|
||||||
|
return; // no player avoiding when with semiclip plugin
|
||||||
|
}
|
||||||
|
|
||||||
m_hindrance = nullptr;
|
m_hindrance = nullptr;
|
||||||
float distanceSq = cr::sqrf (348.0f);
|
float distanceSq = cr::sqrf (348.0f);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue