Merge remote-tracking branch 'origin/testing' into testing
This commit is contained in:
commit
620e73d0e5
@ -1282,7 +1282,7 @@ static void DrawText()
|
|||||||
if (float(fov) > 0.0f && float(fov) < 180)
|
if (float(fov) > 0.0f && float(fov) < 180)
|
||||||
{
|
{
|
||||||
// Dont show ring while player is dead
|
// Dont show ring while player is dead
|
||||||
if (LOCAL_E->m_bAlivePlayer())
|
if (CE_GOOD(LOCAL_E) && LOCAL_E->m_bAlivePlayer())
|
||||||
{
|
{
|
||||||
rgba_t color = GUIColor();
|
rgba_t color = GUIColor();
|
||||||
color.a = float(fovcircle_opacity);
|
color.a = float(fovcircle_opacity);
|
||||||
|
@ -208,7 +208,7 @@ static bool stayNearPlayers(const bot_class_config &config, CachedEntity *&resul
|
|||||||
for (int i = 1; i < g_IEngine->GetMaxClients(); i++)
|
for (int i = 1; i < g_IEngine->GetMaxClients(); i++)
|
||||||
{
|
{
|
||||||
CachedEntity *ent = ENTITY(i);
|
CachedEntity *ent = ENTITY(i);
|
||||||
if (CE_BAD(ent) || !ent->m_bAlivePlayer() || !ent->m_bEnemy() || player_tools::shouldTarget(ent) != player_tools::IgnoreReason::DO_NOT_IGNORE)
|
if (CE_BAD(ent) || !ent->m_bAlivePlayer() || !ent->m_bEnemy() || player_tools::shouldTarget(ent) != player_tools::IgnoreReason::DO_NOT_IGNORE || (hacks::shared::aimbot::ignore_cloak && IsPlayerInvisible(ent)))
|
||||||
continue;
|
continue;
|
||||||
players.push_back(ent);
|
players.push_back(ent);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <settings/String.hpp>
|
#include <settings/String.hpp>
|
||||||
#include "HookedMethods.hpp"
|
#include "HookedMethods.hpp"
|
||||||
|
#include "PlayerTools.hpp"
|
||||||
|
|
||||||
static settings::String ipc_name{ "name.ipc", "" };
|
static settings::String ipc_name{ "name.ipc", "" };
|
||||||
static settings::String force_name{ "name.custom", "" };
|
static settings::String force_name{ "name.custom", "" };
|
||||||
@ -42,7 +43,10 @@ bool StolenName()
|
|||||||
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info))
|
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info))
|
||||||
{
|
{
|
||||||
// Invisible character won't fit into name with max. length
|
// Invisible character won't fit into name with max. length
|
||||||
if (std::strlen(info.name) >= 32)
|
if (std::strlen(info.name) >= 31)
|
||||||
|
continue;
|
||||||
|
// Ignore Friendly
|
||||||
|
if (player_tools::shouldTargetSteamId(info.friendsID) != player_tools::IgnoreReason::DO_NOT_IGNORE)
|
||||||
continue;
|
continue;
|
||||||
// If our name is the same as current, then change it
|
// If our name is the same as current, then change it
|
||||||
if (stolen_name == info.name && *namesteal == 1)
|
if (stolen_name == info.name && *namesteal == 1)
|
||||||
@ -143,7 +147,7 @@ static InitRoutine init([]() {
|
|||||||
if (new_val != 0)
|
if (new_val != 0)
|
||||||
{
|
{
|
||||||
const char *xd = GetNamestealName(g_ISteamUser->GetSteamID());
|
const char *xd = GetNamestealName(g_ISteamUser->GetSteamID());
|
||||||
if (CE_BAD(LOCAL_E) || !xd)
|
if (CE_BAD(LOCAL_E) || !xd || !strcmp(LOCAL_E->player_info.name, xd))
|
||||||
return;
|
return;
|
||||||
NET_SetConVar setname("name", xd);
|
NET_SetConVar setname("name", xd);
|
||||||
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
||||||
@ -161,11 +165,17 @@ static void cm()
|
|||||||
{
|
{
|
||||||
if (!namesteal)
|
if (!namesteal)
|
||||||
return;
|
return;
|
||||||
if (!set_name.test_and_set(500000))
|
if (!set_name.test_and_set(300000))
|
||||||
return;
|
return;
|
||||||
const char *name = GetNamestealName(g_ISteamUser->GetSteamID());
|
const char *name = GetNamestealName(g_ISteamUser->GetSteamID());
|
||||||
if (CE_BAD(LOCAL_E) || !name)
|
if (CE_BAD(LOCAL_E) || !name)
|
||||||
return;
|
return;
|
||||||
|
// Didn't change name - update timer a bit
|
||||||
|
if (!strcmp(LOCAL_E->player_info.name, name))
|
||||||
|
{
|
||||||
|
set_name.last += std::chrono::seconds(170);
|
||||||
|
return;
|
||||||
|
}
|
||||||
NET_SetConVar setname("name", name);
|
NET_SetConVar setname("name", name);
|
||||||
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
||||||
if (ch)
|
if (ch)
|
||||||
|
Reference in New Issue
Block a user