fixes and stuff
This commit is contained in:
parent
9195331290
commit
d3ddcf37b6
@ -27,6 +27,7 @@ void Draw();
|
|||||||
|
|
||||||
int FindInVector(size_t id);
|
int FindInVector(size_t id);
|
||||||
int FindNearestValid(Vector vec);
|
int FindNearestValid(Vector vec);
|
||||||
|
int FindNearestValidbyDist(Vector vec, float mindist, float maxdist);
|
||||||
|
|
||||||
class inactivityTracker
|
class inactivityTracker
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,8 @@ IgnoreReason shouldTargetSteamId(unsigned id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto &pl = playerlist::AccessData(id);
|
auto &pl = playerlist::AccessData(id);
|
||||||
if (playerlist::IsFriendly(pl.state) || (pl.state == playerlist::k_EState::CAT && *ignoreCathook))
|
if (playerlist::IsFriendly(pl.state) ||
|
||||||
|
(pl.state == playerlist::k_EState::CAT && *ignoreCathook))
|
||||||
return IgnoreReason::LOCAL_PLAYER_LIST;
|
return IgnoreReason::LOCAL_PLAYER_LIST;
|
||||||
#if ENABLE_ONLINE
|
#if ENABLE_ONLINE
|
||||||
auto *co = online::getUserData(id);
|
auto *co = online::getUserData(id);
|
||||||
|
@ -125,7 +125,7 @@ void NetVars::Init()
|
|||||||
this->m_iObjectType =
|
this->m_iObjectType =
|
||||||
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
|
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
|
||||||
this->m_bMiniBuilding =
|
this->m_bMiniBuilding =
|
||||||
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
|
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
|
||||||
this->m_iTeleState =
|
this->m_iTeleState =
|
||||||
gNetvars.get_offset("DT_ObjectTeleporter", "m_iState");
|
gNetvars.get_offset("DT_ObjectTeleporter", "m_iState");
|
||||||
this->m_flTeleRechargeTime =
|
this->m_flTeleRechargeTime =
|
||||||
|
@ -218,7 +218,8 @@ void CreateMove()
|
|||||||
|
|
||||||
for (angle.y = -180.0f; angle.y < 180.0f; angle.y += 20.0f)
|
for (angle.y = -180.0f; angle.y < 180.0f; angle.y += 20.0f)
|
||||||
{
|
{
|
||||||
if (unifiedCanBackstab(besttarget, angle, i.entorigin, i.collidable.min, i.collidable.max))
|
if (unifiedCanBackstab(besttarget, angle, i.entorigin,
|
||||||
|
i.collidable.min, i.collidable.max))
|
||||||
{
|
{
|
||||||
current_user_cmd->tick_count = i.tickcount;
|
current_user_cmd->tick_count = i.tickcount;
|
||||||
current_user_cmd->viewangles = angle;
|
current_user_cmd->viewangles = angle;
|
||||||
|
@ -124,7 +124,7 @@ void Run()
|
|||||||
float _viewangles = CE_VECTOR(pEntity, netvar.m_angEyeAngles).y;
|
float _viewangles = CE_VECTOR(pEntity, netvar.m_angEyeAngles).y;
|
||||||
float viewangles =
|
float viewangles =
|
||||||
(_viewangles > 180) ? _viewangles - 360 : _viewangles;
|
(_viewangles > 180) ? _viewangles - 360 : _viewangles;
|
||||||
float simtime = CE_FLOAT(pEntity, netvar.m_flSimulationTime);
|
float simtime = CE_FLOAT(pEntity, netvar.m_flSimulationTime);
|
||||||
Vector ent_orig = pEntity->InternalEntity()->GetAbsOrigin();
|
Vector ent_orig = pEntity->InternalEntity()->GetAbsOrigin();
|
||||||
std::array<hitboxData, 18> hbdArray;
|
std::array<hitboxData, 18> hbdArray;
|
||||||
for (size_t i = 0; i < hbdArray.max_size(); i++)
|
for (size_t i = 0; i < hbdArray.max_size(); i++)
|
||||||
@ -135,15 +135,21 @@ void Run()
|
|||||||
}
|
}
|
||||||
hitboxData collidable{};
|
hitboxData collidable{};
|
||||||
{
|
{
|
||||||
collidable.min = RAW_ENT(pEntity)->GetCollideable()->OBBMins() + ent_orig;
|
collidable.min =
|
||||||
collidable.max = RAW_ENT(pEntity)->GetCollideable()->OBBMaxs() + ent_orig;
|
RAW_ENT(pEntity)->GetCollideable()->OBBMins() + ent_orig;
|
||||||
collidable.center = (collidable.min + collidable.max)/2;
|
collidable.max =
|
||||||
|
RAW_ENT(pEntity)->GetCollideable()->OBBMaxs() + ent_orig;
|
||||||
|
collidable.center = (collidable.min + collidable.max) / 2;
|
||||||
}
|
}
|
||||||
auto hdr = g_IModelInfo->GetStudiomodel(RAW_ENT(pEntity)->GetModel());
|
auto hdr = g_IModelInfo->GetStudiomodel(RAW_ENT(pEntity)->GetModel());
|
||||||
headPositions[i][cmd->command_number % getTicks()] =
|
headPositions[i][cmd->command_number % getTicks()] =
|
||||||
BacktrackData{ cmd->tick_count, hbdArray, collidable,
|
BacktrackData{ cmd->tick_count,
|
||||||
viewangles, simtime,
|
hbdArray,
|
||||||
ent_orig, cmd->command_number % getTicks() };
|
collidable,
|
||||||
|
viewangles,
|
||||||
|
simtime,
|
||||||
|
ent_orig,
|
||||||
|
cmd->command_number % getTicks() };
|
||||||
}
|
}
|
||||||
if (iBestTarget != -1 && CanShoot())
|
if (iBestTarget != -1 && CanShoot())
|
||||||
{
|
{
|
||||||
@ -265,23 +271,24 @@ bool ValidTick(BacktrackData &i, CachedEntity *ent)
|
|||||||
{
|
{
|
||||||
// TODO: Fix this func
|
// TODO: Fix this func
|
||||||
|
|
||||||
|
// if (istickvalid[ent->m_IDX][i.index])
|
||||||
// if (istickvalid[ent->m_IDX][i.index])
|
// return true;
|
||||||
// return true;
|
// if (istickinvalid[ent->m_IDX][i.index])
|
||||||
// if (istickinvalid[ent->m_IDX][i.index])
|
// return false;
|
||||||
// return false;
|
// if (IsVectorVisible(g_pLocalPlayer->v_Eye, i.hitboxes[head].center,
|
||||||
// if (IsVectorVisible(g_pLocalPlayer->v_Eye, i.hitboxes[head].center, true))
|
// true))
|
||||||
// if (fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) * 1000.0f -
|
// if (fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) *
|
||||||
// getLatency() - i.simtime * 1000.0f) <= 200.0f)
|
// 1000.0f -
|
||||||
// {
|
// getLatency() - i.simtime * 1000.0f) <= 200.0f)
|
||||||
// istickvalid[ent->m_IDX][i.index] = true;
|
// {
|
||||||
// return true;
|
// istickvalid[ent->m_IDX][i.index] = true;
|
||||||
// }
|
// return true;
|
||||||
// istickinvalid[ent->m_IDX][i.index] = true;
|
// }
|
||||||
// return false;
|
// istickinvalid[ent->m_IDX][i.index] = true;
|
||||||
|
// return false;
|
||||||
|
|
||||||
if (!(fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) * 1000.0f -
|
if (!(fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) * 1000.0f -
|
||||||
getLatency() - i.simtime * 1000.0f) < 200.0f))
|
getLatency() - i.simtime * 1000.0f) < 200.0f))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,9 @@ void do_random_votekick()
|
|||||||
{
|
{
|
||||||
std::vector<int> targets;
|
std::vector<int> targets;
|
||||||
player_info_s local_info;
|
player_info_s local_info;
|
||||||
|
|
||||||
if (CE_BAD(LOCAL_E) || !g_IEngine->GetPlayerInfo(LOCAL_E->m_IDX, &local_info))
|
if (CE_BAD(LOCAL_E) ||
|
||||||
|
!g_IEngine->GetPlayerInfo(LOCAL_E->m_IDX, &local_info))
|
||||||
return;
|
return;
|
||||||
for (int i = 1; i <= g_GlobalVars->maxClients; ++i)
|
for (int i = 1; i <= g_GlobalVars->maxClients; ++i)
|
||||||
{
|
{
|
||||||
@ -92,7 +93,10 @@ void do_random_votekick()
|
|||||||
continue;
|
continue;
|
||||||
if (info.friendsID == local_info.friendsID)
|
if (info.friendsID == local_info.friendsID)
|
||||||
continue;
|
continue;
|
||||||
if (playerlist::AccessData(info.friendsID).state != playerlist::k_EState::RAGE && playerlist::AccessData(info.friendsID).state != playerlist::k_EState::DEFAULT)
|
if (playerlist::AccessData(info.friendsID).state !=
|
||||||
|
playerlist::k_EState::RAGE &&
|
||||||
|
playerlist::AccessData(info.friendsID).state !=
|
||||||
|
playerlist::k_EState::DEFAULT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
targets.push_back(info.userID);
|
targets.push_back(info.userID);
|
||||||
|
@ -260,7 +260,7 @@ void CreateMove()
|
|||||||
ResetEntityStrings(); // Clear any strings entities have
|
ResetEntityStrings(); // Clear any strings entities have
|
||||||
entities_need_repaint.clear(); // Clear data on entities that need redraw
|
entities_need_repaint.clear(); // Clear data on entities that need redraw
|
||||||
int max_clients = g_IEngine->GetMaxClients();
|
int max_clients = g_IEngine->GetMaxClients();
|
||||||
int limit = HIGHEST_ENTITY;
|
int limit = HIGHEST_ENTITY;
|
||||||
|
|
||||||
// If not using any other special esp, we lower the min to the max clients
|
// If not using any other special esp, we lower the min to the max clients
|
||||||
if (!buildings && !proj_esp && !item_esp)
|
if (!buildings && !proj_esp && !item_esp)
|
||||||
@ -1037,7 +1037,7 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
|
|||||||
? "Teleporter"
|
? "Teleporter"
|
||||||
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
|
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
|
||||||
: "Dispenser"));
|
: "Dispenser"));
|
||||||
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
||||||
int IsMini = CE_INT(ent, netvar.m_bMiniBuilding);
|
int IsMini = CE_INT(ent, netvar.m_bMiniBuilding);
|
||||||
if (!IsMini)
|
if (!IsMini)
|
||||||
AddEntityString(ent, format("LV ", level, ' ', name));
|
AddEntityString(ent, format("LV ", level, ' ', name));
|
||||||
@ -1045,14 +1045,17 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
|
|||||||
AddEntityString(ent, format("Mini ", name));
|
AddEntityString(ent, format("Mini ", name));
|
||||||
if (classid == CL_CLASS(CObjectTeleporter))
|
if (classid == CL_CLASS(CObjectTeleporter))
|
||||||
{
|
{
|
||||||
float next_teleport = CE_FLOAT(ent, netvar.m_flTeleRechargeTime);
|
float next_teleport =
|
||||||
|
CE_FLOAT(ent, netvar.m_flTeleRechargeTime);
|
||||||
float yaw_to_exit = CE_FLOAT(ent, netvar.m_flTeleYawToExit);
|
float yaw_to_exit = CE_FLOAT(ent, netvar.m_flTeleYawToExit);
|
||||||
if (yaw_to_exit)
|
if (yaw_to_exit)
|
||||||
{
|
{
|
||||||
if (next_teleport < g_GlobalVars->curtime)
|
if (next_teleport < g_GlobalVars->curtime)
|
||||||
AddEntityString(ent, "Ready");
|
AddEntityString(ent, "Ready");
|
||||||
else
|
else
|
||||||
AddEntityString(ent, format(next_teleport - g_GlobalVars->curtime, "s"));
|
AddEntityString(
|
||||||
|
ent,
|
||||||
|
format(next_teleport - g_GlobalVars->curtime, "s"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "navparser.hpp"
|
#include "navparser.hpp"
|
||||||
#include "FollowBot.hpp"
|
#include "FollowBot.hpp"
|
||||||
#include "NavBot.hpp"
|
#include "NavBot.hpp"
|
||||||
|
#include "PlayerTools.hpp"
|
||||||
|
|
||||||
namespace hacks::tf2::NavBot
|
namespace hacks::tf2::NavBot
|
||||||
{
|
{
|
||||||
@ -16,6 +17,7 @@ static settings::Bool engi_mode("navbot.engi-mode", "false");
|
|||||||
static settings::Bool primary_only("navbot.primary-only", "true");
|
static settings::Bool primary_only("navbot.primary-only", "true");
|
||||||
|
|
||||||
static settings::Bool target_sentry{ "navbot.target-sentry", "true" };
|
static settings::Bool target_sentry{ "navbot.target-sentry", "true" };
|
||||||
|
static settings::Bool stay_near{ "navbot.stay-near", "false" };
|
||||||
static settings::Bool take_tele{ "navbot.take-teleporters", "true" };
|
static settings::Bool take_tele{ "navbot.take-teleporters", "true" };
|
||||||
static settings::Bool enable_fb{ "navbot.medbot", "false" };
|
static settings::Bool enable_fb{ "navbot.medbot", "false" };
|
||||||
static settings::Bool roambot{ "navbot.roaming", "true" };
|
static settings::Bool roambot{ "navbot.roaming", "true" };
|
||||||
@ -158,6 +160,9 @@ CachedEntity *NearestEnemy()
|
|||||||
CachedEntity *ent = ENTITY(i);
|
CachedEntity *ent = ENTITY(i);
|
||||||
if (CE_BAD(ent) || ent->m_Type() != ENTITY_PLAYER)
|
if (CE_BAD(ent) || ent->m_Type() != ENTITY_PLAYER)
|
||||||
continue;
|
continue;
|
||||||
|
if (player_tools::shouldTarget(ent) !=
|
||||||
|
player_tools::IgnoreReason::DO_NOT_IGNORE)
|
||||||
|
continue;
|
||||||
if (ent == LOCAL_E || !ent->m_bAlivePlayer() ||
|
if (ent == LOCAL_E || !ent->m_bAlivePlayer() ||
|
||||||
ent->m_iTeam() == LOCAL_E->m_iTeam())
|
ent->m_iTeam() == LOCAL_E->m_iTeam())
|
||||||
continue;
|
continue;
|
||||||
@ -357,7 +362,21 @@ bool NavToSniperSpot(int priority)
|
|||||||
bool use_preferred = !preferred_sniper_spots.empty();
|
bool use_preferred = !preferred_sniper_spots.empty();
|
||||||
auto snip_spot = use_preferred ? preferred_sniper_spots : sniper_spots;
|
auto snip_spot = use_preferred ? preferred_sniper_spots : sniper_spots;
|
||||||
bool toret = false;
|
bool toret = false;
|
||||||
|
if (*stay_near)
|
||||||
|
{
|
||||||
|
CachedEntity *ent = NearestEnemy();
|
||||||
|
if (CE_GOOD(ent))
|
||||||
|
{
|
||||||
|
int nearestvalid =
|
||||||
|
nav::FindNearestValidbyDist(ent->m_vecOrigin(), 1000, 4000);
|
||||||
|
if (nearestvalid != -1)
|
||||||
|
{
|
||||||
|
auto area = nav::areas[nearestvalid];
|
||||||
|
nav::NavTo(area.m_center, false, true, priority);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (use_preferred)
|
if (use_preferred)
|
||||||
{
|
{
|
||||||
int best_spot = -1;
|
int best_spot = -1;
|
||||||
|
@ -1158,7 +1158,6 @@ void WhatIAmLookingAt(int *result_eindex, Vector *result_pos)
|
|||||||
*result_eindex = -1;
|
*result_eindex = -1;
|
||||||
if (trace.m_pEnt && result_eindex)
|
if (trace.m_pEnt && result_eindex)
|
||||||
*result_eindex = ((IClientEntity *) (trace.m_pEnt))->entindex();
|
*result_eindex = ((IClientEntity *) (trace.m_pEnt))->entindex();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSentryBuster(CachedEntity *entity)
|
bool IsSentryBuster(CachedEntity *entity)
|
||||||
|
@ -218,8 +218,8 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !LAGBOT_MODE
|
#if !LAGBOT_MODE
|
||||||
if (*identify && sendmsg.test_and_set(300000))
|
if (*identify && sendmsg.test_and_set(300000))
|
||||||
chat_stack::Say("!!meow");
|
chat_stack::Say("!!meow");
|
||||||
#endif
|
#endif
|
||||||
if (crypt_chat)
|
if (crypt_chat)
|
||||||
{
|
{
|
||||||
@ -229,24 +229,30 @@ if (*identify && sendmsg.test_and_set(300000))
|
|||||||
{
|
{
|
||||||
std::string msg = ucccccp::decrypt(message);
|
std::string msg = ucccccp::decrypt(message);
|
||||||
#if !LAGBOT_MODE
|
#if !LAGBOT_MODE
|
||||||
// if (ucccccp::decrypt(message) == "meow" &&
|
// if (ucccccp::decrypt(message)
|
||||||
// hacks::shared::antiaim::communicate &&
|
// == "meow" &&
|
||||||
// data[0] != LOCAL_E->m_IDX &&
|
// hacks::shared::antiaim::communicate
|
||||||
// playerlist::AccessData(ENTITY(data[0])).state !=
|
// && data[0] !=
|
||||||
// playerlist::k_EState::CAT)
|
// LOCAL_E->m_IDX &&
|
||||||
// {
|
// playerlist::AccessData(ENTITY(data[0])).state
|
||||||
// playerlist::AccessData(ENTITY(data[0])).state =
|
// !=
|
||||||
// playerlist::k_EState::CAT;
|
// playerlist::k_EState::CAT)
|
||||||
// chat_stack::Say("!!meow");
|
// {
|
||||||
// }
|
// playerlist::AccessData(ENTITY(data[0])).state
|
||||||
|
// =
|
||||||
|
// playerlist::k_EState::CAT;
|
||||||
|
// chat_stack::Say("!!meow");
|
||||||
|
// }
|
||||||
CachedEntity *ent = ENTITY(data[0]);
|
CachedEntity *ent = ENTITY(data[0]);
|
||||||
if (msg != "Attempt at ucccccping and failing" && msg != "Unsupported version" && ent != LOCAL_E)
|
if (msg != "Attempt at ucccccping and failing" &&
|
||||||
|
msg != "Unsupported version" && ent != LOCAL_E)
|
||||||
{
|
{
|
||||||
auto &state = playerlist::AccessData(ent).state;
|
auto &state = playerlist::AccessData(ent).state;
|
||||||
if (state == playerlist::k_EState::DEFAULT)
|
if (state == playerlist::k_EState::DEFAULT)
|
||||||
{
|
{
|
||||||
state = playerlist::k_EState::CAT;
|
state = playerlist::k_EState::CAT;
|
||||||
if (*answerIdentify && sendmsg.test_and_set(5000))
|
if (*answerIdentify &&
|
||||||
|
sendmsg.test_and_set(5000))
|
||||||
chat_stack::Say("!!meow");
|
chat_stack::Say("!!meow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,32 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
|||||||
// This is a INetChannel hook - it SHOULDN'T be static because netchannel
|
// This is a INetChannel hook - it SHOULDN'T be static because netchannel
|
||||||
// changes.
|
// changes.
|
||||||
logging::Info("Disconnect: %s", reason);
|
logging::Info("Disconnect: %s", reason);
|
||||||
if (strstr(reason, "banned") || strstr(reason, "Generic_Kicked"))
|
if (strstr(reason, "Generic_Kicked"))
|
||||||
|
{
|
||||||
|
if (die_if_vac) {
|
||||||
|
static uintptr_t addr =
|
||||||
|
gSignatures.GetClientSignature("C7 04 24 ? ? ? ? 8D 7D ? 31 F6");
|
||||||
|
static uintptr_t offset0 = uintptr_t(*(uintptr_t *) (addr + 0x3));
|
||||||
|
static uintptr_t offset1 = gSignatures.GetClientSignature(
|
||||||
|
"55 89 E5 83 EC ? 8B 45 ? 8B 80 ? ? ? ? 85 C0 74 ? C7 44 24 ? ? ? ? ? "
|
||||||
|
"89 04 24 E8 ? ? ? ? 85 C0 74 ? 8B 40");
|
||||||
|
typedef int (*GetPendingInvites_t)(uintptr_t);
|
||||||
|
GetPendingInvites_t GetPendingInvites = GetPendingInvites_t(offset1);
|
||||||
|
int invites = GetPendingInvites(offset0);
|
||||||
|
|
||||||
|
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
|
||||||
|
re::CTFPartyClient *pc = re::CTFPartyClient::GTFPartyClient();
|
||||||
|
if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch() &&
|
||||||
|
!invites)
|
||||||
|
if (!(pc && pc->BInQueueForMatchGroup(tfmm::getQueue())))
|
||||||
|
{
|
||||||
|
logging::Info("VAC/Matchmaking banned");
|
||||||
|
*(int *) 0 = 0;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strstr(reason, "banned"))
|
||||||
{
|
{
|
||||||
if (die_if_vac)
|
if (die_if_vac)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,44 @@ int FindInVector(size_t id)
|
|||||||
}
|
}
|
||||||
static int bestarea = -1;
|
static int bestarea = -1;
|
||||||
Timer reselect{};
|
Timer reselect{};
|
||||||
|
int FindNearestValidbyDist(Vector vec, float mindist, float maxdist)
|
||||||
|
{
|
||||||
|
if (reselect.test_and_set(500))
|
||||||
|
{
|
||||||
|
float bestscr = FLT_MAX;
|
||||||
|
if (bestarea != -1)
|
||||||
|
{
|
||||||
|
bool success = false;
|
||||||
|
Vector area = areas[bestarea].m_center;
|
||||||
|
float scr = area.DistTo(vec);
|
||||||
|
if (scr < maxdist && scr > mindist)
|
||||||
|
if (IsVectorVisible(vec, area, false))
|
||||||
|
success = true;
|
||||||
|
if (!success)
|
||||||
|
bestarea = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bestarea = -1;
|
||||||
|
for (int ar = 0; ar < areas.size(); ar++)
|
||||||
|
{
|
||||||
|
Vector area = areas[ar].m_center;
|
||||||
|
area.z += 72.0f;
|
||||||
|
float scr = area.DistTo(vec);
|
||||||
|
if (scr > maxdist || scr < mindist)
|
||||||
|
continue;
|
||||||
|
if (scr > bestscr)
|
||||||
|
continue;
|
||||||
|
if (IsVectorVisible(vec, area, false))
|
||||||
|
{
|
||||||
|
bestscr = scr;
|
||||||
|
bestarea = ar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bestarea;
|
||||||
|
}
|
||||||
int FindNearestValid(Vector vec)
|
int FindNearestValid(Vector vec)
|
||||||
{
|
{
|
||||||
if (reselect.test_and_set(500))
|
if (reselect.test_and_set(500))
|
||||||
@ -238,8 +276,8 @@ static std::vector<Vector> crumbs;
|
|||||||
static bool ensureArrival;
|
static bool ensureArrival;
|
||||||
// Priority value for current instructions, only higher or equal priorites can
|
// Priority value for current instructions, only higher or equal priorites can
|
||||||
// overwrite it
|
// overwrite it
|
||||||
int priority = 0;
|
int priority = 0;
|
||||||
static Vector lastArea = { 0.0f, 0.0f, 0.0f };
|
static Vector lastArea = { 0.0f, 0.0f, 0.0f };
|
||||||
static int persistentTries = 0;
|
static int persistentTries = 0;
|
||||||
|
|
||||||
// dest = Destination, navToLocalCenter = Should bot travel to local center
|
// dest = Destination, navToLocalCenter = Should bot travel to local center
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
#include <settings/Bool.hpp>
|
#include <settings/Bool.hpp>
|
||||||
|
|
||||||
static settings::Bool requeue{ "hack.requeue-on-kick", "false" };
|
static settings::Bool requeue{ "hack.requeue-on-kick", "false" };
|
||||||
static settings::Bool vote_kicky{"hack.autovote.yes", "false"};
|
static settings::Bool vote_kicky{ "hack.autovote.yes", "false" };
|
||||||
static settings::Bool vote_kickn{"hack.autovote.no", "false"};
|
static settings::Bool vote_kickn{ "hack.autovote.no", "false" };
|
||||||
|
|
||||||
namespace votelogger
|
namespace votelogger
|
||||||
{
|
{
|
||||||
@ -47,10 +47,16 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
|||||||
if (eid == LOCAL_E->m_IDX)
|
if (eid == LOCAL_E->m_IDX)
|
||||||
was_local_player = true;
|
was_local_player = true;
|
||||||
if (*vote_kickn)
|
if (*vote_kickn)
|
||||||
if (playerlist::AccessData(info.friendsID).state != playerlist::k_EState::RAGE && playerlist::AccessData(info.friendsID).state != playerlist::k_EState::DEFAULT)
|
if (playerlist::AccessData(info.friendsID).state !=
|
||||||
|
playerlist::k_EState::RAGE &&
|
||||||
|
playerlist::AccessData(info.friendsID).state !=
|
||||||
|
playerlist::k_EState::DEFAULT)
|
||||||
g_IEngine->ClientCmd_Unrestricted("vote option2");
|
g_IEngine->ClientCmd_Unrestricted("vote option2");
|
||||||
if (*vote_kicky)
|
if (*vote_kicky)
|
||||||
if (playerlist::AccessData(info.friendsID).state == playerlist::k_EState::RAGE || playerlist::AccessData(info.friendsID).state == playerlist::k_EState::DEFAULT)
|
if (playerlist::AccessData(info.friendsID).state ==
|
||||||
|
playerlist::k_EState::RAGE ||
|
||||||
|
playerlist::AccessData(info.friendsID).state ==
|
||||||
|
playerlist::k_EState::DEFAULT)
|
||||||
g_IEngine->ClientCmd_Unrestricted("vote option1");
|
g_IEngine->ClientCmd_Unrestricted("vote option1");
|
||||||
logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID,
|
logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID,
|
||||||
reason);
|
reason);
|
||||||
|
Reference in New Issue
Block a user