Merge pull request #1176 from nullworks/totallynotelite

Fix disguised spies being ignored, fix auth to rage users
This commit is contained in:
TotallyNotElite 2020-11-24 10:23:42 +01:00 committed by GitHub
commit e4f196866d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ void EndConVars();
bool IsPlayerInvulnerable(CachedEntity *player);
bool IsPlayerCritBoosted(CachedEntity *player);
bool IsPlayerInvisible(CachedEntity *player, bool check_stealth = true);
bool IsPlayerInvisible(CachedEntity *player);
bool IsPlayerDisguised(CachedEntity *player);
bool IsPlayerResistantToCurrentWeapon(CachedEntity *player);

View File

@ -465,7 +465,7 @@ bool ShouldAim()
if (HasCondition<TFCond_Taunting>(g_pLocalPlayer->entity))
return false;
// Is cloaked
if (IsPlayerInvisible(g_pLocalPlayer->entity, false))
if (IsPlayerInvisible(g_pLocalPlayer->entity))
return false;
}
#if ENABLE_VISUALS

View File

@ -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, false) || CE_BYTE(LOCAL_E, netvar.m_bFeignDeathReady))
if (CE_BAD(LOCAL_E) || g_pLocalPlayer->life_state || CE_BAD(LOCAL_W) || !HasKnife() || IsPlayerInvisible(LOCAL_E) || CE_BYTE(LOCAL_E, netvar.m_bFeignDeathReady))
return;
if (!CanShoot())
return;

View File

@ -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, false))
if (IsPlayerInvisible(g_pLocalPlayer->entity))
return false;
if (IsAmbassador(g_pLocalPlayer->weapon()))

View File

@ -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 check_stealth)
bool IsPlayerInvisible(CachedEntity *player)
{
return HasConditionMask<KInvisibilityMask.cond_0, KInvisibilityMask.cond_1, KInvisibilityMask.cond_2, KInvisibilityMask.cond_3>(player) || (check_stealth && HasConditionMask<KStealthedMask.cond_0, KStealthedMask.cond_1, KStealthedMask.cond_2, KStealthedMask.cond_3>(player));
return HasConditionMask<KInvisibilityMask.cond_0, KInvisibilityMask.cond_1, KInvisibilityMask.cond_2, KInvisibilityMask.cond_3>(player);
}
bool IsPlayerDisguised(CachedEntity *player)

View File

@ -80,7 +80,7 @@ void ProcessSendline(IGameEvent *kv)
return;
// CA7 = Reply and change state
// CA8 = Change state
if (id == CAT_IDENTIFY && *answerIdentify && player_idx != g_pLocalPlayer->entity_idx)
if (id == CAT_IDENTIFY && *answerIdentify && player_idx != g_pLocalPlayer->entity_idx && playerlist::AccessData(info.friendsID).state != playerlist::k_EState::RAGE)
send_drawline_reply = true;
if (playerlist::ChangeState(info.friendsID, playerlist::k_EState::CAT))
PrintChat("\x07%06X%s\x01 Marked as CAT (Cathook user)", 0xe05938, info.name);