fix: pingfaker overwrites pings for real players (resolves #572)
fix: crash bug introduced in #569
This commit is contained in:
parent
747eb569c1
commit
ee964e0c9a
14 changed files with 322 additions and 188 deletions
|
|
@ -975,15 +975,17 @@ void Bot::selectWeapons (float distance, int index, int id, int choosen) {
|
|||
// if we're have a glock or famas vary burst fire mode
|
||||
checkBurstMode (distance);
|
||||
|
||||
if (hasShield () && m_shieldCheckTime < game.time () && getCurrentTaskId () != Task::Camp) // better shield gun usage
|
||||
{
|
||||
// better shield gun usage
|
||||
if (hasShield () && m_shieldCheckTime < game.time () && getCurrentTaskId () != Task::Camp) {
|
||||
const bool hasEnemy = !game.isNullEntity (m_enemy);
|
||||
|
||||
if (distance >= 750.0f && !isShieldDrawn ()) {
|
||||
pev->button |= IN_ATTACK2; // draw the shield
|
||||
}
|
||||
else if (isShieldDrawn ()
|
||||
|| m_isReloading
|
||||
|| !seesEntity (m_enemy->v.origin)
|
||||
|| (!game.isNullEntity (m_enemy) && (m_enemy->v.button & IN_RELOAD))) {
|
||||
|| (hasEnemy && (m_enemy->v.button & IN_RELOAD))
|
||||
|| (hasEnemy && !seesEntity (m_enemy->v.origin))) {
|
||||
|
||||
pev->button |= IN_ATTACK2; // draw out the shield
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue