diff --git a/.gitignore b/.gitignore index 4959fab8..79cd09d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.d *.o -bin/* \ No newline at end of file +bin/* +/core diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 3cc21ada..067a806d 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -128,7 +128,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { } if (found_entity && CE_GOOD(found_entity)) { - if (jointeam && team_joining_state == 1 && (g_GlobalVars->curtime - last_jointeam_try) > 1.0f) { + if (jointeam && (g_GlobalVars->curtime - last_jointeam_try) > 1.0f) { last_jointeam_try = g_GlobalVars->curtime; switch (CE_INT(found_entity, netvar.iTeamNum)) { case TEAM_RED: diff --git a/src/ipc.cpp b/src/ipc.cpp index 926c4738..63e40a0d 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -12,14 +12,6 @@ namespace ipc { -void CommandCallback(cat_ipc::command_s& command, void* payload) { - if (!strcmp("exec", (const char*)command.cmd_data) && payload) { - //std::lock_guard lock(hack::command_stack_mutex); - hack::command_stack().push(std::string((const char*)payload)); - } else if (!strcmp("owner", (const char*)command.cmd_data) && payload) { - } -} - std::atomic thread_running(false); pthread_t listener_thread { 0 }; @@ -50,6 +42,12 @@ CatCommand connect("ipc_connect", "Connect to IPC server", []() { logging::Info("peer count: %i", peer->memory->peer_count); logging::Info("magic number: 0x%08x", peer->memory->global_data.magic_number); logging::Info("magic number offset: 0x%08x", (uintptr_t)&peer->memory->global_data.magic_number - (uintptr_t)peer->memory); + peer->SetCommandHandler(commands::execute_client_cmd, [](cat_ipc::command_s& command, void* payload) { + hack::command_stack().push(std::string((const char*)&command.cmd_data)); + }); + peer->SetCommandHandler(commands::execute_client_cmd_long, [](cat_ipc::command_s& command, void* payload) { + hack::command_stack().push(std::string((const char*)payload)); + }); hacks::shared::followbot::AddMessageHandlers(peer); StoreClientData(); thread_running = true; diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 94905c76..3bc8661f 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -12,6 +12,7 @@ void LocalPlayer::Update() { entity_idx = g_IEngine->GetLocalPlayer(); entity = ENTITY(entity_idx); if (CE_BAD(entity)) { + team = 0; return; } team = CE_INT(entity, netvar.iTeamNum);