Stealth spell counts as being cloaked (#1147)
This commit is contained in:
parent
dc91ef291f
commit
bcf774624a
@ -73,7 +73,7 @@ void EndConVars();
|
||||
|
||||
bool IsPlayerInvulnerable(CachedEntity *player);
|
||||
bool IsPlayerCritBoosted(CachedEntity *player);
|
||||
bool IsPlayerInvisible(CachedEntity *player);
|
||||
bool IsPlayerInvisible(CachedEntity *player, bool check_stealth = true);
|
||||
bool IsPlayerDisguised(CachedEntity *player);
|
||||
bool IsPlayerResistantToCurrentWeapon(CachedEntity *player);
|
||||
|
||||
|
@ -456,7 +456,7 @@ bool ShouldAim()
|
||||
if (HasCondition<TFCond_Taunting>(g_pLocalPlayer->entity))
|
||||
return false;
|
||||
// Is cloaked
|
||||
if (IsPlayerInvisible(g_pLocalPlayer->entity))
|
||||
if (IsPlayerInvisible(g_pLocalPlayer->entity, false))
|
||||
return false;
|
||||
}
|
||||
#if ENABLE_VISUALS
|
||||
|
@ -315,7 +315,7 @@ void CreateMove()
|
||||
{
|
||||
if (!enabled)
|
||||
return;
|
||||
if (CE_BAD(LOCAL_E) || g_pLocalPlayer->life_state || CE_BAD(LOCAL_W) || !HasKnife() || IsPlayerInvisible(LOCAL_E) || CE_BYTE(LOCAL_E, netvar.m_bFeignDeathReady))
|
||||
if (CE_BAD(LOCAL_E) || g_pLocalPlayer->life_state || CE_BAD(LOCAL_W) || !HasKnife() || IsPlayerInvisible(LOCAL_E, false) || CE_BYTE(LOCAL_E, netvar.m_bFeignDeathReady))
|
||||
return;
|
||||
if (!CanShoot())
|
||||
return;
|
||||
|
@ -191,7 +191,7 @@ bool ShouldShoot()
|
||||
if (HasCondition<TFCond_Taunting>(g_pLocalPlayer->entity))
|
||||
return false;
|
||||
// Check if player is cloaked
|
||||
if (IsPlayerInvisible(g_pLocalPlayer->entity))
|
||||
if (IsPlayerInvisible(g_pLocalPlayer->entity, false))
|
||||
return false;
|
||||
|
||||
if (IsAmbassador(g_pLocalPlayer->weapon()))
|
||||
|
@ -1488,9 +1488,9 @@ bool IsPlayerCritBoosted(CachedEntity *player)
|
||||
return HasConditionMask<KCritBoostMask.cond_0, KCritBoostMask.cond_1, KCritBoostMask.cond_2, KCritBoostMask.cond_3>(player);
|
||||
}
|
||||
|
||||
bool IsPlayerInvisible(CachedEntity *player)
|
||||
bool IsPlayerInvisible(CachedEntity *player, bool check_stealth)
|
||||
{
|
||||
return HasConditionMask<KInvisibilityMask.cond_0, KInvisibilityMask.cond_1, KInvisibilityMask.cond_2, KInvisibilityMask.cond_3>(player);
|
||||
return HasConditionMask<KInvisibilityMask.cond_0, KInvisibilityMask.cond_1, KInvisibilityMask.cond_2, KInvisibilityMask.cond_3>(player) || (check_stealth && HasCondition<TFCond_Stealthed>(player));
|
||||
}
|
||||
|
||||
bool IsPlayerDisguised(CachedEntity *player)
|
||||
|
Reference in New Issue
Block a user