bot: ignoring some parameters for throwing grenades (#488)

add: cvar "yv_grenadier_mode" bot will ignore throwing grenade condition if enabled
This commit is contained in:
Alexander Shkarlatov 2023-10-18 23:13:23 +04:00 committed by GitHub
commit 8c60149c70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 6 deletions

View file

@ -1084,8 +1084,8 @@ void Bot::throwExplosive_ () {
ignoreCollision ();
if (pev->origin.distanceSq (dest) < cr::sqrf (450.0f)) {
// heck, I don't wanna blow up myself
if (!game.mapIs(MapFlags::GrenadeWar) && (pev->origin.distanceSq (dest) < cr::sqrf (450.0f))) {
// heck, I don't wanna blow up myself
m_grenadeCheckTime = game.time () + kGrenadeCheckTime * 2.0f;
selectBestWeapon ();
@ -1099,7 +1099,7 @@ void Bot::throwExplosive_ () {
m_grenade = calcToss (pev->origin, dest);
}
if (m_grenade.lengthSq () <= 100.0f) {
if (!game.mapIs(MapFlags::GrenadeWar) && (m_grenade.lengthSq () <= 100.0f)) {
m_grenadeCheckTime = game.time () + kGrenadeCheckTime * 2.0f;
selectBestWeapon ();