CONDITION UPDATE!

This commit is contained in:
nullifiedcat 2017-01-15 20:31:37 +03:00
parent 1002f247b7
commit cf61a132c0
17 changed files with 155 additions and 95 deletions

View File

@ -25,6 +25,7 @@
#include "vfunc.h"
#include "hooks.h"
#include "prediction.h"
#include "conditions.h"
#include "ipc/ipcctl.h"
#include "hacks/Aimbot.h"

View File

@ -18,9 +18,76 @@ bool BitCheck(condition_data_s data, condition cond) {
if (cond > 32 * 1) {
return data.cond_1 & (1 << (cond % 32));
}
return data.cond_1 & (1 << (cond));
return data.cond_0 & (1 << (cond));
}
void CondBitSet(condition_data_s data, condition cond, bool state) {
if (state) {
if (cond > 32 * 3) {
data.cond_3 |= (1 << (cond % 32));
} else if (cond > 32 * 2) {
data.cond_2 |= (1 << (cond % 32));
} else if (cond > 32 * 1) {
data.cond_1 |= (1 << (cond % 32));
} else {
data.cond_0 |= (1 << (cond));
}
} else {
if (cond > 32 * 3) {
data.cond_3 &= ~(1 << (cond % 32));
} else if (cond > 32 * 2) {
data.cond_2 &= ~(1 << (cond % 32));
} else if (cond > 32 * 1) {
data.cond_1 &= ~(1 << (cond % 32));
} else {
data.cond_0 &= ~(1 << (cond));
}
}
}
void OldCondSet(CachedEntity* ent, condition cond, bool state) {
if (state) {
if (cond > 32 * 3) {
CE_INT(ent, netvar.iCond3) |= (1 << (cond % 32));
} else if (cond > 32 * 2) {
CE_INT(ent, netvar.iCond2) |= (1 << (cond % 32));
} else if (cond > 32 * 1) {
CE_INT(ent, netvar.iCond1) |= (1 << (cond % 32));
} else {
CE_INT(ent, netvar.iCond) |= (1 << (cond));
}
} else {
if (cond > 32 * 3) {
CE_INT(ent, netvar.iCond3) &= ~(1 << (cond % 32));
} else if (cond > 32 * 2) {
CE_INT(ent, netvar.iCond2) &= ~(1 << (cond % 32));
} else if (cond > 32 * 1) {
CE_INT(ent, netvar.iCond1) &= ~(1 << (cond % 32));
} else {
CE_INT(ent, netvar.iCond) &= ~(1 << (cond));
}
}
}
condition_data_s FromOldNetvars(CachedEntity* ent) {
condition_data_s result;
result.cond_0 = CE_INT(ent, netvar.iCond);
result.cond_1 = CE_INT(ent, netvar.iCond1);
result.cond_2 = CE_INT(ent, netvar.iCond2);
result.cond_3 = CE_INT(ent, netvar.iCond3);
return result;
}
bool HasCondition(CachedEntity* ent, condition cond) {
return BitCheck(CE_VAR(ent, netvar._condition_bits, condition_data_s), cond);
return BitCheck(CE_VAR(ent, netvar._condition_bits, condition_data_s), cond) || BitCheck(FromOldNetvars(ent), cond);
}
void AddCondition(CachedEntity* ent, condition cond) {
CondBitSet(CE_VAR(ent, netvar._condition_bits, condition_data_s), cond, true);
OldCondSet(ent, cond, true);
}
void RemoveCondition(CachedEntity* ent, condition cond) {
CondBitSet(CE_VAR(ent, netvar._condition_bits, condition_data_s), cond, false);
OldCondSet(ent, cond, false);
}

View File

@ -18,7 +18,7 @@ struct condition_data_s {
};
enum condition {
TFCond_Slowed,
TFCond_Slowed = 0,
TFCond_Zoomed,
TFCond_Disguising,
TFCond_Disguised,
@ -27,12 +27,12 @@ enum condition {
TFCond_TeleportedGlow,
TFCond_Taunting,
TFCond_UberchargeFading,
TFCond_Unknown1,
TFCond_CloakFlicker,
TFCond_Unknown1, //9
TFCond_CloakFlicker = 9,
TFCond_Teleporting,
TFCond_Kritzkrieged,
TFCond_Unknown2,
TFCond_TmpDamageBonus,
TFCond_Unknown2, //12
TFCond_TmpDamageBonus = 12,
TFCond_DeadRingered,
TFCond_Bonked,
TFCond_Dazed,
@ -52,7 +52,7 @@ enum condition {
TFCond_RegenBuffed,
TFCond_MarkedForDeath,
TFCond_NoHealingDamageBuff,
TFCond_SpeedBuffAlly,
TFCond_SpeedBuffAlly, // 32
TFCond_HalloweenCritCandy,
TFCond_CritCanteen,
TFCond_CritDemoCharge,
@ -84,7 +84,7 @@ enum condition {
TFCond_SmallBulletResist,
TFCond_SmallBlastResist,
TFCond_SmallFireResist,
TFCond_Stealthed,
TFCond_Stealthed, // 64
TFCond_MedigunDebuff,
TFCond_StealthedUserBuffFade,
TFCond_BulletImmune,
@ -98,7 +98,9 @@ enum condition {
TFCond_HalloweenTiny,
TFCond_HalloweenInHell,
TFCond_HalloweenGhostMode,
TFCond_DodgeChance,
TFCond_MiniCritOnKill,
TFCond_DodgeChance, //79
TFCond_ObscuredSmoke = 79,
TFCond_Parachute,
TFCond_BlastJumping,
TFCond_HalloweenKart,
@ -106,7 +108,8 @@ enum condition {
TFCond_BalloonHead,
TFCond_MeleeOnly,
TFCond_SwimmingCurse,
TFCond_HalloweenKartNoTurn,
TFCond_HalloweenKartNoTurn, //87
TFCond_FreezeInput = 87,
TFCond_HalloweenKartCage,
TFCond_HasRune,
TFCond_RuneStrength,
@ -115,11 +118,8 @@ enum condition {
TFCond_RuneResist,
TFCond_RuneVampire,
TFCond_RuneWarlock,
TFCond_RunePrecision,
TFCond_RunePrecision, // 96
TFCond_RuneAgility,
TFCond_MiniCritOnKill,
TFCond_ObscuredSmoke,
TFCond_FreezeInput,
TFCond_GrapplingHook,
TFCond_GrapplingHookSafeFall,
TFCond_GrapplingHookLatched,
@ -136,13 +136,19 @@ enum condition {
TFCond_SupernovaRune,
TFCond_Plague,
TFCond_KingAura,
TFCond_SpawnOutline,
TFCond_SpawnOutline, //114
TFCond_KnockedIntoAir,
TFCond_CompetitiveWinner,
TFCond_CompetitiveLoser
TFCond_CompetitiveLoser,
TFCond_NoTaunting
};
bool BitCheck(condition_data_s data, unsigned cond);
bool CondBitCheck(condition_data_s data, unsigned cond);
void CondBitSet(condition_data_s data, condition cond, bool state);
void OldCondSet(CachedEntity* ent, condition cond, bool state);
condition_data_s FromOldNetvars(CachedEntity* ent);
bool HasCondition(CachedEntity* ent, condition cond);
void AddCondition(CachedEntity* ent, condition cond);
void RemoveCondition(CachedEntity* ent, condition cond);
#endif /* CONDITIONS_H_ */

View File

@ -195,7 +195,7 @@ Color colors::EntityF(CachedEntity* ent) {
if (ent->m_iTeam == TEAM_BLU) result = blu_u;
else if (ent->m_iTeam == TEAM_RED) result = red_u;
}
if (CE_INT(ent, netvar.iCond1) & cond_ex::vacc_bullet) {
if (HasCondition(ent, TFCond_UberBulletResist)) {
if (ent->m_iTeam == TEAM_BLU) result = blu_v;
else if (ent->m_iTeam == TEAM_RED) result = red_v;
}

View File

@ -15,7 +15,7 @@ enum EntityType {
ENTITY_PROJECTILE
};
enum cond {
/*enum cond {
slowed = (1 << 0),
zoomed = (1 << 1),
disguised = (1 << 3),
@ -93,7 +93,7 @@ enum cond_ex3 {
powerup_plague = (1 << 14),
powerup_supernova = (1 << 15),
airblasted = (1 << 19)
};
};*/
enum powerup_type {
not_powerup = -1,

View File

@ -106,7 +106,7 @@ bool Aimbot::CreateMove(void*, float, CUserCmd* cmd) {
}
}
if (g_pLocalPlayer->cond_0 & cond::taunting) return true;
if (HasCondition(g_pLocalPlayer->entity, TFCond_Taunting)) return true;
switch (GetWeaponMode(g_pLocalPlayer->entity)) {
case weapon_medigun:
@ -117,7 +117,7 @@ bool Aimbot::CreateMove(void*, float, CUserCmd* cmd) {
return true;
};
if (g_pLocalPlayer->cond_0 & cond::cloaked) return true; // TODO other kinds of cloak
if (HasCondition(g_pLocalPlayer->entity, TFCond_Cloaked)) return true; // TODO other kinds of cloak
// TODO m_bFeignDeathReady no aim
if (this->v_bActiveOnlyWhenCanShoot->GetBool()) {
// Miniguns should shoot and aim continiously. TODO smg
@ -135,7 +135,7 @@ bool Aimbot::CreateMove(void*, float, CUserCmd* cmd) {
}
if (g_pLocalPlayer->weapon()->m_iClassID == ClassID::CTFMinigun) {
if (!(g_pLocalPlayer->cond_0 & cond::slowed)) {
if (!HasCondition(g_pLocalPlayer->entity, TFCond_Slowed)) {
return true;
}
if (!(cmd->buttons & IN_ATTACK2)) {
@ -324,7 +324,7 @@ int Aimbot::BestHitbox(CachedEntity* target, int preferred) {
bool Aimbot::ShouldTarget(CachedEntity* entity) {
// Just assuming CE is good
if (entity->m_Type == ENTITY_PLAYER) {
if (g_Settings.bIgnoreTaunting->GetBool() && (CE_INT(entity, netvar.iCond) & cond::taunting)) return false;
if (g_Settings.bIgnoreTaunting->GetBool() && HasCondition(entity, TFCond_Taunting)) return false;
#if NO_DEVIGNORE != true
if (Developer(entity)) return false; // TODO developer relation
#endif
@ -339,8 +339,7 @@ bool Aimbot::ShouldTarget(CachedEntity* entity) {
if (GetWeaponMode(g_pLocalPlayer->entity) == weaponmode::weapon_melee) {
if (entity->m_flDistance > 95) return false;
}
int econd = CE_INT(entity, netvar.iCond1);
if ((econd & cond_ex::vacc_bullet)) return false;
if (HasCondition(entity, TFCond_UberBulletResist)) return false;
if (GetRelation(entity) == relation::FRIEND) return false;
Vector resultAim;
int hitbox = BestHitbox(entity, m_iPreferredHitbox);

View File

@ -27,7 +27,7 @@ void AntiDisguise::PaintTraverse(void*, unsigned int, bool, bool) {
if (CE_BAD(ent)) continue;
if (ent->m_Type == ENTITY_PLAYER) {
if (CE_INT(ent, netvar.iClass) == tf_class::tf_spy) {
CE_INT(ent, netvar.iCond) = CE_INT(ent, netvar.iCond) &~ cond::disguised;
RemoveCondition(ent, TFCond_Disguised);
}
}
}

View File

@ -26,7 +26,7 @@ bool bDoubleJumpFix = false;
bool Bunnyhop::CreateMove(void* thisptr, float sampling, CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return true;
if (g_pLocalPlayer->cond_3 & cond_ex3::grappling) return true;
if (HasCondition(g_pLocalPlayer->entity, TFCond_GrapplingHook)) return true;
int flags = CE_INT(g_pLocalPlayer->entity, netvar.iFlags);
if (v_bAutoJump->GetBool()) {

View File

@ -76,7 +76,7 @@ ESP::ESP() {
void ESP::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax) {
if (CE_BAD(ent)) return;
bool cloak = ent->m_iClassID == ClassID::CTFPlayer && IsPlayerInvisible(ent);//(CE_INT(ent, netvar.iCond) & cond::cloaked);
bool cloak = ent->m_iClassID == ClassID::CTFPlayer && IsPlayerInvisible(ent);
Vector min, max;
RAW_ENT(ent)->GetRenderBounds(min, max);
Vector origin = RAW_ENT(ent)->GetAbsOrigin();
@ -127,7 +127,7 @@ void ESP::ProcessEntityPT(CachedEntity* ent) {
Color fg = colors::EntityF(ent);
switch (ent->m_Type) {
case ENTITY_PLAYER: {
bool cloak = IsPlayerInvisible(ent);//CE_INT(ent, netvar.iCond) & cond::cloaked;
bool cloak = IsPlayerInvisible(ent);
if (v_bLegit->GetBool() && ent->m_iTeam != g_pLocalPlayer->team && !GetRelation(ent)) {
if (cloak) return;
if (ent->m_lLastSeen > v_iLegitSeenTicks->GetInt()) {
@ -270,14 +270,12 @@ void ESP::ProcessEntity(CachedEntity* ent) {
if (!(this->v_bSeeLocal->GetBool() && interfaces::iinput->CAM_IsThirdPerson()) &&
ent->m_IDX == interfaces::engineClient->GetLocalPlayer()) break;
int pclass = CE_INT(ent, netvar.iClass);
int pcond = CE_INT(ent, netvar.iCond);
player_info_t info;
if (!interfaces::engineClient->GetPlayerInfo(ent->m_IDX, &info)) return;
powerup_type power = GetPowerupOnPlayer(ent);
// If target is enemy, always show powerups, if player is teammate, show powerups
// only if bTeammatePowerup or bTeammates is true
if (v_bLegit->GetBool() && ent->m_iTeam != g_pLocalPlayer->team && !GetRelation(ent)) {
//if (pcond & cond::cloaked) return;
if (IsPlayerInvisible(ent)) return;
if (ent->m_lLastSeen > (unsigned)v_iLegitSeenTicks->GetInt()) {
return;
@ -300,16 +298,16 @@ void ESP::ProcessEntity(CachedEntity* ent) {
ent->AddESPString(color, bgclr, "%i / %i HP", ent->m_iHealth, ent->m_iMaxHealth);
}
if (v_bShowConditions->GetBool()) {
if (pcond & cond::cloaked) {
ent->AddESPString(color, bgclr, "CLOAKED");
if (IsPlayerInvisible(ent)) {
ent->AddESPString(color, bgclr, "INVISIBLE");
}
if (IsPlayerInvulnerable(ent)) {
ent->AddESPString(color, bgclr, "INVULNERABLE");
}
if (CE_INT(ent, netvar.iCond1) & cond_ex::vacc_bullet) {
if (HasCondition(ent, TFCond_UberBulletResist)) {
ent->AddESPString(color, bgclr, "VACCINATOR ACTIVE");
}
if (CE_INT(ent, netvar.iCond1) & cond_ex::vacc_pbullet) {
if (HasCondition(ent, TFCond_SmallBulletResist)) {
ent->AddESPString(color, bgclr, "VACCINATOR PASSIVE");
}
if (IsPlayerCritBoosted(ent)) {

View File

@ -229,6 +229,18 @@ void CC_SetValue(const CCommand& args) {
delete [] value;
}
void CC_DumpConds(const CCommand& args) {
if (args.ArgC() < 1) return;
if (!atoi(args[1])) return;
int idx = atoi(args[1]);
CachedEntity* ent = ENTITY(idx);
if (CE_BAD(ent)) return;
condition_data_s d1 = CE_VAR(ent, netvar._condition_bits, condition_data_s);
condition_data_s d2 = FromOldNetvars(ent);
logging::Info("0x%08x 0x%08x 0x%08x 0x%08x", d1.cond_0, d1.cond_1, d1.cond_2, d1.cond_3);
logging::Info("0x%08x 0x%08x 0x%08x 0x%08x", d2.cond_0, d2.cond_1, d2.cond_2, d2.cond_3);
}
Misc::Misc() {
v_bDebugInfo = CreateConVar(CON_PREFIX "misc_debug", "0", "Debug info");
c_Name = CreateConCommand(CON_PREFIX "name", CC_SetName, "Sets custom name");
@ -239,6 +251,7 @@ Misc::Misc() {
c_AddRage = CreateConCommand(CON_PREFIX "addrage", CC_AddRage, "Adds player to rage list");
c_DumpVars = CreateConCommand(CON_PREFIX "dumpent", CC_DumpVars, "Dumps entity data");
c_DumpPlayers = CreateConCommand(CON_PREFIX "dumpplayers", CC_DumpPlayers, "Dumps player data");
c_DumpConds = CreateConCommand(CON_PREFIX "dumpconds", CC_DumpConds, "Dumps conditions");
c_Teamname = CreateConCommand(CON_PREFIX "teamname", CC_Teamname, "Team name");
c_Lockee = CreateConCommand(CON_PREFIX "lockee", CC_Lockee, "Lock/Unlock commands");
c_Reset = CreateConCommand(CON_PREFIX "reset_lists", CC_ResetLists, "Remove all friends and rage");

View File

@ -32,6 +32,7 @@ public:
ConCommand* c_Teamname;
ConCommand* c_Lockee;
ConCommand* c_Info;
ConCommand* c_DumpConds;
ConCommand* c_Reset;
ConCommand* c_Disconnect;
ConCommand* c_DisconnectVAC;

View File

@ -102,7 +102,7 @@ bool Triggerbot::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) {
cmd->buttons |= IN_ATTACK;
return true;
}
if ((CE_INT(entity, netvar.iCond2) & cond_ex::vacc_bullet) && v_bIgnoreVaccinator->GetBool()) return true;
if (HasCondition(entity, TFCond_UberBulletResist) && v_bIgnoreVaccinator->GetBool()) return true;
relation rel = GetRelation(entity);
if (rel == relation::FRIEND || rel == relation::DEVELOPER) return true;
if (IsPlayerInvulnerable(entity)) return true;

View File

@ -33,28 +33,17 @@ void EndConVars() {
bool IsPlayerInvulnerable(CachedEntity* player) {
int cond1 = CE_INT(player, netvar.iCond);
int cond2 = CE_INT(player, netvar.iCond1);
int uber_mask_1 = (cond::uber | cond::bonk);
int uber_mask_2 = (cond_ex::hidden_uber | cond_ex::canteen_uber | cond_ex::misc_uber | cond_ex::phlog_uber);
if ((cond1 & uber_mask_1) || (cond2 & uber_mask_2)) {
//logging::Info("COND1: %i MASK1: %i", cond1, uber_mask_1);
//logging::Info("COND2: %i MASK2: %i", cond2, uber_mask_2);
return true;
}
return false;
return (HasCondition(player, TFCond_Ubercharged) || HasCondition(player, TFCond_UberchargedCanteen)
|| HasCondition(player, TFCond_UberchargedHidden) || HasCondition(player, TFCond_UberchargedOnTakeDamage)
|| HasCondition(player, TFCond_Bonked) || HasCondition(player, TFCond_DefenseBuffMmmph));
}
bool IsPlayerCritBoosted(CachedEntity* player) {
int cond1 = CE_INT(player, netvar.iCond);
int cond2 = CE_INT(player, netvar.iCond1);
int cond4 = CE_INT(player, netvar.iCond3);
int crit_mask_1 = (cond::kritzkrieg);
int crit_mask_2 = (cond_ex::halloween_crit | cond_ex::canteen_crit | cond_ex::first_blood_crit | cond_ex::winning_crit |
cond_ex::intelligence_crit | cond_ex::on_kill_crit | cond_ex::phlog_crit | cond_ex::misc_crit);
int crit_mask_4 = (cond_ex3::powerup_crit);
if ((cond1 & crit_mask_1) || (cond2 & crit_mask_2) || (cond4 & crit_mask_4)) return true;
return false;
return (HasCondition(player, TFCond_Kritzkrieged) || HasCondition(player, TFCond_CritRuneTemp)
|| HasCondition(player, TFCond_CritCanteen) || HasCondition(player, TFCond_CritMmmph)
|| HasCondition(player, TFCond_CritOnKill) || HasCondition(player, TFCond_CritOnDamage)
|| HasCondition(player, TFCond_CritOnFirstBlood) || HasCondition(player, TFCond_CritOnWin)
|| HasCondition(player, TFCond_CritRuneTemp) || HasCondition(player, TFCond_HalloweenCritCandy));
}
ConVar* CreateConVar(const char* name, const char* value, const char* help) {
@ -149,23 +138,19 @@ item_type GetItemType(CachedEntity* entity) {
}
powerup_type GetPowerupOnPlayer(CachedEntity* player) {
if (!player) return powerup_type::not_powerup;
int cond2 = CE_INT(player, netvar.iCond2);
int cond3 = CE_INT(player, netvar.iCond3);
//if (!(cond2 & cond_ex2::powerup_generic)) return powerup_type::not_powerup;
if (cond2 & cond_ex2::powerup_strength) return powerup_type::strength;
if (cond2 & cond_ex2::powerup_haste) return powerup_type::haste;
if (cond2 & cond_ex2::powerup_regen) return powerup_type::regeneration;
if (cond2 & cond_ex2::powerup_resistance) return powerup_type::resistance;
if (cond2 & cond_ex2::powerup_vampire) return powerup_type::vampire;
if (cond2 & cond_ex2::powerup_reflect) return powerup_type::reflect;
if (cond3 & cond_ex3::powerup_precision) return powerup_type::precision;
if (cond3 & cond_ex3::powerup_agility) return powerup_type::agility;
if (cond3 & cond_ex3::powerup_knockout) return powerup_type::knockout;
if (cond3 & cond_ex3::powerup_king) return powerup_type::king;
if (cond3 & cond_ex3::powerup_plague) return powerup_type::plague;
if (cond3 & cond_ex3::powerup_supernova) return powerup_type::supernova;
if (!CE_BAD(player)) return powerup_type::not_powerup;
if (HasCondition(player, TFCond_RuneStrength)) return powerup_type::strength;
if (HasCondition(player, TFCond_RuneHaste)) return powerup_type::haste;
if (HasCondition(player, TFCond_RuneRegen)) return powerup_type::regeneration;
if (HasCondition(player, TFCond_RuneResist)) return powerup_type::resistance;
if (HasCondition(player, TFCond_RuneVampire)) return powerup_type::vampire;
if (HasCondition(player, TFCond_RuneWarlock)) return powerup_type::reflect;
if (HasCondition(player, TFCond_RunePrecision)) return powerup_type::precision;
if (HasCondition(player, TFCond_RuneAgility)) return powerup_type::agility;
if (HasCondition(player, TFCond_RuneKnockout)) return powerup_type::knockout;
if (HasCondition(player, TFCond_KingRune)) return powerup_type::king;
if (HasCondition(player, TFCond_PlagueRune)) return powerup_type::plague;
if (HasCondition(player, TFCond_SupernovaRune)) return powerup_type::supernova;
return powerup_type::not_powerup;
}
@ -230,12 +215,10 @@ void FixMovement(CUserCmd& cmd, Vector& viewangles) {
}
bool IsPlayerInvisible(CachedEntity* player) {
int cond = CE_INT(player, netvar.iCond);
int mask = cloaked;
int cond_1 = CE_INT(player, netvar.iCond1);
int mask_1 = cond_ex2::cloak_spell | cond_ex2::cloak_spell_fading;
int mask_v = on_fire | jarate | milk;
return !((cond & mask_v) || !((cond & mask) || (cond_1 & mask_1)));
return (HasCondition(player, TFCond_Cloaked) && !(
HasCondition(player, TFCond_OnFire) || HasCondition(player, TFCond_Jarated)
|| HasCondition(player, TFCond_CloakFlicker) || HasCondition(player, TFCond_Milked)
|| HasCondition(player, TFCond_Bleeding)));
}
float RandFloatRange(float min, float max)

View File

@ -98,7 +98,7 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
if (g_Settings.bNoZoom->GetBool()) {
if (CE_GOOD(g_pLocalPlayer->entity)) {
CE_INT(g_pLocalPlayer->entity, netvar.iCond) = CE_INT(g_pLocalPlayer->entity, netvar.iCond) &~ cond::zoomed;
RemoveCondition(g_pLocalPlayer->entity, condition::TFCond_Zoomed);
}
}
}

View File

@ -20,10 +20,6 @@ void LocalPlayer::Update() {
v_ViewOffset = CE_VECTOR(entity, netvar.vViewOffset);
v_Origin = entity->m_vecOrigin;
v_Eye = v_Origin + v_ViewOffset;
cond_0 = CE_INT(entity, netvar.iCond);
cond_1 = CE_INT(entity, netvar.iCond1);
cond_2 = CE_INT(entity, netvar.iCond1);
cond_3 = CE_INT(entity, netvar.iCond3);
clazz = CE_INT(entity, netvar.iClass);
health = CE_INT(entity, netvar.iHealth);
this->bUseSilentAngles = false;

View File

@ -21,11 +21,6 @@ public:
int flags;
char life_state;
int clazz;
int cond_0;
int cond_1;
int cond_2;
int cond_3;
bool bZoomed;
float flZoomBegin;
@ -41,6 +36,9 @@ public:
bool bAttackLastTick;
};
#define LOCAL_E g_pLocalPlayer->entity
#define LOCAL_W g_pLocalPlayer->weapon()
extern LocalPlayer* g_pLocalPlayer;
#endif /* LOCALPLAYER_H_ */

View File

@ -37,10 +37,8 @@ int GetScoreForEntity(CachedEntity* entity) {
int clazz = CE_INT(entity, netvar.iClass);
int health = CE_INT(entity, netvar.iHealth);
float distance = (g_pLocalPlayer->v_Origin - entity->m_vecOrigin).Length();
bool zoomed = (CE_INT(entity, netvar.iCond) & cond::zoomed);
int condx = (CE_INT(entity, netvar.iCond1));
int condx2 = (CE_INT(entity, netvar.iCond2));
bool pbullet = (condx & cond_ex::vacc_pbullet);
bool zoomed = HasCondition(entity, TFCond_Zoomed);
bool pbullet = HasCondition(entity, TFCond_SmallBulletResist);
bool special = false;
bool kritz = IsPlayerCritBoosted(entity);
int total = 0;
@ -62,7 +60,7 @@ int GetScoreForEntity(CachedEntity* entity) {
special = true;
break;
case tf_soldier:
if (condx2 & cond_ex2::rocket_jumping) total += 30;
if (HasCondition(entity, TFCond_BlastJumping)) total += 30;
break;
}
if (!special) {