diff --git a/.cproject b/.cproject
index 0e5365b1..23b823c8 100644
--- a/.cproject
+++ b/.cproject
@@ -67,6 +67,7 @@
+
diff --git a/src/drawex.cpp b/src/drawex.cpp
index 2d613c03..deef79ef 100644
--- a/src/drawex.cpp
+++ b/src/drawex.cpp
@@ -36,7 +36,7 @@ void rendering_routine()
while (true)
{
xpcmutex_lock(server_throttle_mutex);
- PROF_SECTION(DRAWEX_rendering_routine)
+ PROF_SECTION(DRAWEX_rendering_routine);
if (hack::initialized && api::ready_state)
{
BeginCheatVisuals();
@@ -49,7 +49,7 @@ void rendering_routine()
EndCheatVisuals();
}
xpcmutex_unlock(server_throttle_mutex);
- usleep(1000000 / 100);
+ usleep(1000000 / 45);
//std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
diff --git a/src/entityhitboxcache.cpp b/src/entityhitboxcache.cpp
index 737a3167..4fe4577e 100644
--- a/src/entityhitboxcache.cpp
+++ b/src/entityhitboxcache.cpp
@@ -82,6 +82,8 @@ bool EntityHitboxCache::VisibilityCheck(int id) {
static CatEnum setupbones_time_enum({ "ZERO", "CURTIME", "LP SERVERTIME", "SIMTIME" });
static CatVar setupbones_time(setupbones_time_enum, "setupbones_time", "3", "Setupbones", "Defines setupbones 4th argument, change it if your aimbot misses, idk!!");
+std::mutex setupbones_mutex;
+
matrix3x4_t* EntityHitboxCache::GetBones() {
static float bones_setup_time = 0.0f;
switch ((int)setupbones_time) {
@@ -97,6 +99,7 @@ matrix3x4_t* EntityHitboxCache::GetBones() {
bones_setup_time = CE_FLOAT(parent_ref, netvar.m_flSimulationTime);
}
if (!bones_setup) {
+ std::lock_guard lock(setupbones_mutex);
bones_setup = RAW_ENT(parent_ref)->SetupBones(bones, MAXSTUDIOBONES, 0x100, bones_setup_time);
}
return bones;
diff --git a/src/globals.h b/src/globals.h
index a34b56e6..3ca37472 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -45,6 +45,7 @@ class GlobalSettings {
public:
void Init();
bool bInvalid { true };
+ bool is_create_move { false };
Vector last_angles;
};
diff --git a/src/helpers.cpp b/src/helpers.cpp
index 488748c0..581872cf 100644
--- a/src/helpers.cpp
+++ b/src/helpers.cpp
@@ -335,6 +335,7 @@ bool IsEntityVisible(CachedEntity* entity, int hb) {
}
+std::mutex trace_lock;
bool IsEntityVectorVisible(CachedEntity* entity, Vector endpos) {
trace_t trace_object;
Ray_t ray;
@@ -347,6 +348,7 @@ bool IsEntityVectorVisible(CachedEntity* entity, Vector endpos) {
ray.Init(g_pLocalPlayer->v_Eye, endpos);
{
PROF_SECTION(IEVV_TraceRay);
+ std::lock_guard lock(trace_lock);
g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_default, &trace_object);
}
return (trace_object.fraction >= 0.99f || (((IClientEntity*)trace_object.m_pEnt)) == RAW_ENT(entity));
diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp
index 1b70f990..14f1655d 100644
--- a/src/hooks/CreateMove.cpp
+++ b/src/hooks/CreateMove.cpp
@@ -104,6 +104,7 @@ static CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0", "Debug Proj
static CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag");
bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
+ g_Settings.is_create_move = true;
static CreateMove_t original_method = (CreateMove_t)hooks::clientmode.GetMethod(offsets::CreateMove());
bool time_replaced, ret, speedapplied;
float curtime_old, servertime, speed, yaw;
@@ -125,15 +126,18 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
PROF_SECTION(CreateMove);
if (!cmd) {
+ g_Settings.is_create_move = false;
return ret;
}
if (!cathook) {
+ g_Settings.is_create_move = false;
return ret;
}
if (!g_IEngine->IsInGame()) {
g_Settings.bInvalid = true;
+ g_Settings.is_create_move = false;
return true;
}
@@ -281,6 +285,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
}
// Walkbot can leave game.
if (!g_IEngine->IsInGame()) {
+ g_Settings.is_create_move = false;
return ret;
}
IF_GAME (IsTF()) {
@@ -427,6 +432,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
//LoadSavedState();
}
g_pLocalPlayer->bAttackLastTick = (cmd->buttons & IN_ATTACK);
+ g_Settings.is_create_move = false;
return ret;
SEGV_END;