From 4128b27cf4063b263694882e85327d7c9286be3e Mon Sep 17 00:00:00 2001 From: jeefo Date: Mon, 25 Mar 2024 14:25:44 +0300 Subject: [PATCH] nav: destroy breakables not only when touching them (ref #541) build: use symbol versioning only with glibc (ref #540) --- ext/crlib | 2 +- src/botlib.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/crlib b/ext/crlib index 131abb7..721b245 160000 --- a/ext/crlib +++ b/ext/crlib @@ -1 +1 @@ -Subproject commit 131abb70839b6d8c5d359fdeb20aa90e1e8b38dd +Subproject commit 721b245b0ed971b643f64ccb9366500df6e7895b diff --git a/src/botlib.cpp b/src/botlib.cpp index 07559bd..a16e39a 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -156,10 +156,7 @@ void Bot::avoidGrenades () { } void Bot::checkBreakable (edict_t *touch) { - if (!util.isShootableBreakable (touch)) { - return; - } - m_breakableEntity = lookupBreakable (); + m_breakableEntity = touch != nullptr ? touch : lookupBreakable (); if (game.isNullEntity (m_breakableEntity)) { return; @@ -3185,6 +3182,9 @@ void Bot::logic () { if (m_checkTerrain) { doPlayerAvoidance (dirNormal); checkTerrain (movedDistance, dirNormal); + + // check for breakables around bots movement direction + checkBreakable (nullptr); } // check the darkness