diff --git a/include/MiscTemporary.hpp b/include/MiscTemporary.hpp index 6d59bf1c..644467a4 100644 --- a/include/MiscTemporary.hpp +++ b/include/MiscTemporary.hpp @@ -8,6 +8,7 @@ #include "common.hpp" // This is a temporary file to put code that needs moving/refactoring in. +extern CatVar no_steps; extern bool *bSendPackets; extern CatVar no_zoom; extern CatVar clean_screenshots; diff --git a/include/conditions.hpp b/include/conditions.hpp index f2b8c6f2..65975fe2 100755 --- a/include/conditions.hpp +++ b/include/conditions.hpp @@ -211,7 +211,8 @@ template inline bool CondBitCheck(condition_data_s &data) } if (cond < 32) { - return data.cond_0 & (1u << (cond)); + if (data.cond_0) + return data.cond_0 & (1u << (cond)); } return false; } @@ -257,7 +258,8 @@ inline void CondBitSet(condition_data_s &data) } else { - data.cond_0 |= (1 << (cond)); + if (data.cond_0) + data.cond_0 |= (1 << (cond)); } } else @@ -276,7 +278,8 @@ inline void CondBitSet(condition_data_s &data) } else { - data.cond_0 &= ~(1u << (cond)); + if (data.cond_0) + data.cond_0 &= ~(1u << (cond)); } } } @@ -313,4 +316,4 @@ template inline void RemoveCondition(CachedEntity *ent) CE_VAR(ent, netvar._condition_bits, condition_data_s)); } CondBitSet(CE_VAR(ent, netvar.iCond, condition_data_s)); -} \ No newline at end of file +} diff --git a/include/hooks.hpp b/include/hooks.hpp index ccbe0b17..3d95ded1 100644 --- a/include/hooks.hpp +++ b/include/hooks.hpp @@ -54,6 +54,7 @@ public: }; extern VMTHook panel; +extern VMTHook localbaseent; extern VMTHook clientmode; extern VMTHook clientmode4; extern VMTHook client; diff --git a/src/hooks.cpp b/src/hooks.cpp index 058e06fa..10685e71 100644 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -93,6 +93,7 @@ void VMTHook::Apply() } VMTHook input{}; +VMTHook localbaseent{}; VMTHook steamfriends{}; VMTHook baseclientstate{}; VMTHook baseclientstate8{}; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index c5c0bfb3..45b65dd0 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -41,7 +41,6 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd) float frameTime = g_GlobalVars->frametime; float curTime = g_GlobalVars->curtime; - CUserCmd defaultCmd; if (ucmd == NULL) { diff --git a/src/ipc.cpp b/src/ipc.cpp index 723d4c46..5715ca95 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -23,7 +23,9 @@ CatCommand fix_deadlock("ipc_fix_deadlock", "Fix deadlock", []() { pthread_mutex_unlock(&peer->memory->mutex); } }); - +CatCommand id("ipc_id", "Echo ipc id", []() { + logging::Info("%d",ipc::peer->client_id); +}); CatCommand connect("ipc_connect", "Connect to IPC server", []() { if (peer) { diff --git a/src/reclasses/CTFGCClientSystem.cpp b/src/reclasses/CTFGCClientSystem.cpp index 8954bc34..326fd145 100644 --- a/src/reclasses/CTFGCClientSystem.cpp +++ b/src/reclasses/CTFGCClientSystem.cpp @@ -15,7 +15,7 @@ CTFGCClientSystem *CTFGCClientSystem::GTFGCClientSystem() typedef CTFGCClientSystem *(*GTFGCClientSystem_t)(); static uintptr_t addr1 = gSignatures.GetClientSignature( "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 " - "8D B6 00 00 00 00 A1 ? ? ? ?"); + "8D B6 00 00 00 00 A1"); static GTFGCClientSystem_t GTFGCClientSystem_fn = GTFGCClientSystem_t(addr1); @@ -26,7 +26,7 @@ void CTFGCClientSystem::AbandonCurrentMatch() { typedef void *(*AbandonCurrentMatch_t)(CTFGCClientSystem *); static uintptr_t addr1 = gSignatures.GetClientSignature( - "55 89 E5 57 56 8D 75 ? 53 81 EC ? ? ? ? C7 04 24 ? ? ? ?"); + "55 89 E5 57 56 8D 75 ? 53 81 EC ? ? ? ? C7 04 24"); static AbandonCurrentMatch_t AbandonCurrentMatch_fn = AbandonCurrentMatch_t(addr1); if (AbandonCurrentMatch_fn == nullptr) @@ -40,7 +40,7 @@ bool CTFGCClientSystem::BConnectedToMatchServer(bool flag) { typedef bool (*BConnectedToMatchServer_t)(CTFGCClientSystem *, bool); static uintptr_t addr = - gSignatures.GetClientSignature("55 89 E5 53 80 7D ? ? 8B 55 ? 75 ?"); + gSignatures.GetClientSignature("55 89 E5 53 80 7D ? ? 8B 55 ? 75"); static BConnectedToMatchServer_t BConnectedToMatchServer_fn = BConnectedToMatchServer_t(addr); @@ -51,7 +51,7 @@ bool CTFGCClientSystem::BHaveLiveMatch() { typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *); static uintptr_t addr = gSignatures.GetClientSignature( - "55 31 C0 89 E5 53 8B 4D ? 0F B6 91 ? ? ? ?"); + "55 31 C0 89 E5 53 8B 4D ? 0F B6 91"); static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr); if (BHaveLiveMatch_fn == nullptr) { diff --git a/src/tfmm.cpp b/src/tfmm.cpp index db8f9c06..8749b567 100644 --- a/src/tfmm.cpp +++ b/src/tfmm.cpp @@ -52,11 +52,25 @@ void queue_leave() else logging::Info("queue_start: CTFPartyClient == null!"); } - +Timer abandont{}; +CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon", []() { + re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); + if (client) { + abandon(); + while (1) { + if (abandont.test_and_set(4000)) { + queue_leave(); + break; + } + } + } + else + logging::Info("your party client is gay!"); +}); void abandon() { re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem(); - if (gc != nullptr) + if (gc != nullptr && gc->BConnectedToMatchServer(false)) gc->AbandonCurrentMatch(); else logging::Info("abandon: CTFGCClientSystem == null!"); diff --git a/src/visual/EffectChams.cpp b/src/visual/EffectChams.cpp index f6d240bc..411770cf 100644 --- a/src/visual/EffectChams.cpp +++ b/src/visual/EffectChams.cpp @@ -129,7 +129,7 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity) switch (ent->m_Type) { case ENTITY_BUILDING: - if (!ent->m_bEnemy && !(teammates || teammate_buildings)) + if (!ent->m_bEnemy && !(teammates || teammate_buildings) && (!(chamsR || chamsB || chamsG) && ent != LOCAL_E)) { return colors::empty; } @@ -178,7 +178,7 @@ bool EffectChams::ShouldRenderChams(IClientEntity *entity) if (ent->m_iHealth == 0 || !ent->m_iHealth) return false; if (CE_BYTE(LOCAL_E, netvar.m_bCarryingObject) && - LOCAL_E->m_vecOrigin.DistTo(ent->m_vecOrigin) <= 85.0f) + LOCAL_E->m_vecOrigin.DistTo(ent->m_vecOrigin) <= 100.0f) return false; return true; case ENTITY_PLAYER: