diff --git a/inc/engine.h b/inc/engine.h index 5b1555f..b48799b 100644 --- a/inc/engine.h +++ b/inc/engine.h @@ -602,7 +602,7 @@ public: public: template T read () { T result {}; - auto size = sizeof (T); + constexpr auto size = sizeof (T); if (m_cursor + size > m_buffer.length ()) { return 0; @@ -616,12 +616,12 @@ public: // must be called right after read template void write (T value) { - auto size = sizeof (value); + constexpr auto size = sizeof (value); memcpy (m_buffer.data () + m_cursor - size, &value, size); } template void skip () { - auto size = sizeof (T); + constexpr auto size = sizeof (T); if (m_cursor + size > m_buffer.length ()) { return; diff --git a/src/navigate.cpp b/src/navigate.cpp index 4f9c5fe..11f2511 100644 --- a/src/navigate.cpp +++ b/src/navigate.cpp @@ -7,6 +7,8 @@ #include +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 () { if (m_isCreature) { if (!graph.m_terrorPoints.empty ()) { @@ -422,6 +424,10 @@ void Bot::ignoreCollision () { } void Bot::doPlayerAvoidance (const Vector &normal) { + if (cv_has_team_semiclip.bool_ ()) { + return; // no player avoiding when with semiclip plugin + } + m_hindrance = nullptr; float distanceSq = cr::sqrf (348.0f);