aim: allow to not ignore glass when tracing for enemies (ref #654)
this thing is controllable via yb_aim_trace_consider_glass cvar, and by default is off
This commit is contained in:
parent
3a014e471b
commit
6152a2d2ce
1 changed files with 2 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ ConVar cv_check_enemy_invincibility ("check_enemy_invincibility", "0", "Enables
|
||||||
ConVar cv_stab_close_enemies ("stab_close_enemies", "1", "Enables or disables bot ability to stab the enemy with knife if bot is in good condition.");
|
ConVar cv_stab_close_enemies ("stab_close_enemies", "1", "Enables or disables bot ability to stab the enemy with knife if bot is in good condition.");
|
||||||
ConVar cv_use_engine_pvs_check ("use_engine_pvs_check", "0", "Use engine to check potential visibility of an enemy.");
|
ConVar cv_use_engine_pvs_check ("use_engine_pvs_check", "0", "Use engine to check potential visibility of an enemy.");
|
||||||
ConVar cv_use_hitbox_enemy_targeting ("use_hitbox_enemy_targeting", "0", "Use hitbox-based enemy targeting, instead of offset based. Use with the yb_use_engine_pvs_check enabled to reduce CPU usage.");
|
ConVar cv_use_hitbox_enemy_targeting ("use_hitbox_enemy_targeting", "0", "Use hitbox-based enemy targeting, instead of offset based. Use with the yb_use_engine_pvs_check enabled to reduce CPU usage.");
|
||||||
|
ConVar cv_aim_trace_consider_glass ("aim_trace_consider_glass", "0", "Bots will consider glass when deciding to shoot enemies. Required for very special maps only.");
|
||||||
|
|
||||||
ConVar mp_friendlyfire ("mp_friendlyfire", nullptr, Var::GameRef);
|
ConVar mp_friendlyfire ("mp_friendlyfire", nullptr, Var::GameRef);
|
||||||
ConVar sv_gravity ("sv_gravity", nullptr, Var::GameRef);
|
ConVar sv_gravity ("sv_gravity", nullptr, Var::GameRef);
|
||||||
|
|
@ -192,7 +193,7 @@ bool Bot::checkBodyPartsWithOffsets (edict_t *target) {
|
||||||
auto self = pev->pContainingEntity;
|
auto self = pev->pContainingEntity;
|
||||||
|
|
||||||
// creatures can't hurt behind anything
|
// creatures can't hurt behind anything
|
||||||
const auto ignoreFlags = m_isCreature ? TraceIgnore::None : TraceIgnore::Everything;
|
const auto ignoreFlags = m_isCreature ? TraceIgnore::None : (cv_aim_trace_consider_glass ?TraceIgnore::Monsters : TraceIgnore::Everything);
|
||||||
|
|
||||||
const auto hitsTarget = [&] () -> bool {
|
const auto hitsTarget = [&] () -> bool {
|
||||||
return result.flFraction >= 1.0f || result.pHit == target;
|
return result.flFraction >= 1.0f || result.pHit == target;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue