This commit is contained in:
TotallyNotElite 2018-07-30 18:59:45 +02:00
parent 0249521086
commit 155af2ebb7
5 changed files with 13 additions and 24 deletions

View File

@ -98,7 +98,6 @@ std::unique_ptr<char[]> strfmt(const char *fmt, ...);
// TODO move that to weaponid.h // TODO move that to weaponid.h
bool HasWeapon(CachedEntity *ent, int wantedId); bool HasWeapon(CachedEntity *ent, int wantedId);
bool IsAmbassador(CachedEntity *ent); bool IsAmbassador(CachedEntity *ent);
bool HasDarwins(CachedEntity *ent);
bool AmbassadorCanHeadshot(); bool AmbassadorCanHeadshot();
inline const char *teamname(int team) inline const char *teamname(int team)

View File

@ -111,7 +111,7 @@ static CatVar setupbones_time(
setupbones_time_enum, "setupbones_time", "3", "Setupbones", setupbones_time_enum, "setupbones_time", "3", "Setupbones",
"Defines setupbones 4th argument, change it if your aimbot misses, idk!!"); "Defines setupbones 4th argument, change it if your aimbot misses, idk!!");
std::mutex setupbones_mutex; static std::mutex setupbones_mutex;
matrix3x4_t *EntityHitboxCache::GetBones() matrix3x4_t *EntityHitboxCache::GetBones()
{ {

View File

@ -71,7 +71,11 @@ int BulletDangerValue(CachedEntity *patient)
any_zoomed_snipers = true; any_zoomed_snipers = true;
// TODO VisCheck from patient. // TODO VisCheck from patient.
if ((int) vacc_sniper == 1) if ((int) vacc_sniper == 1)
if (!IsEntityVisible(ent, head)) if (!IsEntityVisible(ent, head) &&
!IsVectorVisible(ENTITY(m_iCurrentHealingTarget)
->hitboxes.GetHitbox(head)
->center,
ent->hitboxes.GetHitbox(head)->center, true))
continue; continue;
return vacc_sniper ? 2 : 1; return vacc_sniper ? 2 : 1;
} }

View File

@ -841,7 +841,6 @@ index_t SelectNextNode()
return FindNearestNode(true); return FindNearestNode(true);
} }
auto &n = state::nodes[state::active_node]; auto &n = state::nodes[state::active_node];
// TODO medkit connections and shit
std::vector<index_t> chance{}; std::vector<index_t> chance{};
for (index_t i = 0; i < MAX_CONNECTIONS; i++) for (index_t i = 0; i < MAX_CONNECTIONS; i++)
{ {

View File

@ -544,20 +544,6 @@ bool HasWeapon(CachedEntity *ent, int wantedId)
return false; return false;
} }
bool HasDarwins(CachedEntity *ent)
{
if (CE_BAD(ent))
return false;
// Check if player is sniper
if (CE_INT(ent, netvar.iClass) != tf_sniper)
return false;
// Check if player is using darwins, 231 is the id for darwins danger sheild
if (HasWeapon(ent, 231))
return true;
// Else return false
return false;
}
void VectorTransform(const float *in1, const matrix3x4_t &in2, float *out) void VectorTransform(const float *in1, const matrix3x4_t &in2, float *out)
{ {
out[0] = (in1[0] * in2[0][0] + in1[1] * in2[0][1] + in1[2] * in2[0][2]) + out[0] = (in1[0] * in2[0][0] + in1[1] * in2[0][1] + in1[2] * in2[0][2]) +
@ -724,7 +710,6 @@ float RandFloatRange(float min, float max)
bool IsEntityVisible(CachedEntity *entity, int hb) bool IsEntityVisible(CachedEntity *entity, int hb)
{ {
Vector hit;
if (g_Settings.bInvalid) if (g_Settings.bInvalid)
return false; return false;
if (entity == g_pLocalPlayer->entity) if (entity == g_pLocalPlayer->entity)
@ -936,7 +921,10 @@ weaponmode GetWeaponMode()
classid == CL_CLASS(CTFSyringeGun) || classid == CL_CLASS(CTFSyringeGun) ||
classid == CL_CLASS(CTFCrossbow) || classid == CL_CLASS(CTFCrossbow) ||
classid == CL_CLASS(CTFShotgunBuildingRescue) || classid == CL_CLASS(CTFShotgunBuildingRescue) ||
classid == CL_CLASS(CTFDRGPomson)) classid == CL_CLASS(CTFDRGPomson) ||
classid == CL_CLASS(CTFWeaponFlameBall) ||
classid == CL_CLASS(CTFRaygun) ||
classid == CL_CLASS(CTFGrapplingHook))
{ {
return weaponmode::weapon_projectile; return weaponmode::weapon_projectile;
} }
@ -1382,10 +1370,9 @@ void PrintChat(const char *fmt, ...)
va_start(list, fmt); va_start(list, fmt);
vsprintf(buf.get(), fmt, list); vsprintf(buf.get(), fmt, list);
va_end(list); va_end(list);
std::unique_ptr<char> str(strfmt("\x07%06X[\x07%06XCAT\x07%06X]\x01 %s", std::unique_ptr<char[]> str =
0x5e3252, 0xba3d9a, 0x5e3252, std::move(strfmt("\x07%06X[\x07%06XCAT\x07%06X]\x01 %s", 0x5e3252,
buf.get()) 0xba3d9a, 0x5e3252, buf.get()));
.release());
// FIXME DEBUG LOG // FIXME DEBUG LOG
logging::Info("%s", str.get()); logging::Info("%s", str.get());
chat->Printf(str.get()); chat->Printf(str.get());