Don't path away from sentry if it doesn't have ammo (#1544)

Don't path away from sentry if it doesn't have ammo

Co-authored-by: BenCat07 <BenCat07@gmail.com>
This commit is contained in:
Sinner 2021-10-11 10:22:59 +02:00 committed by GitHub
parent 35a0597066
commit 39053dae45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -368,7 +368,9 @@ public:
// Should we even ignore the sentry?
// Soldier/Heavy do not care about Level 1 or mini sentries
bool is_strong_class = g_pLocalPlayer->clazz == tf_soldier || g_pLocalPlayer->clazz == tf_heavy;
if (is_strong_class && (CE_BYTE(ent, netvar.m_bMiniBuilding) || CE_INT(ent, netvar.iUpgradeLevel) == 1))
int bullet = CE_INT(ent, netvar.m_iAmmoShells);
int rocket = CE_INT(ent, netvar.m_iAmmoRockets);
if ((is_strong_class && (CE_BYTE(ent, netvar.m_bMiniBuilding) || CE_INT(ent, netvar.iUpgradeLevel) == 1)) || (bullet == 0 && (CE_INT(ent, netvar.iUpgradeLevel) != 3 || rocket == 0)))
continue;
// It's still building/being sapped, ignore.