diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index 0bb33409..87388e74 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -585,14 +585,17 @@ static const std::string list_tf2 = R"( "Miscellaneous" [ "Miscellaneous Settings" - "removecond_master" - "removecond_value" - "removecond_key" - "removecond_fire" - "removecond_taunt" - "removecond_bleeding" - "removecond_stun" - "spycrab" + "Remove Cond" [ + "Remove Cond Exploit" + "removecond_master" + "removecond_value" + "removecond_key" + "removecond_fire" + "removecond_taunt" + "removecond_bleeding" + "removecond_stun" + "spycrab" + ] "Spy Alert" [ "Spy Alert Settings" "spyalert_enabled" diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index bd588541..a53eedc8 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -134,6 +134,7 @@ int StartSceneEvent_hooked(IClientEntity* _this, int sceneInfo, int choreoScene, float last_bucket = 0; static CatVar tauntslide_moveable(CV_SWITCH, "tauntslide_moveable", "0", "Taunt Slide", "Allows free movement while taunting with movable taunts\nOnly works in tf2\nWIP"); +static CatVar tauntslide_debug(CV_SWITCH, "tauntslide_debug", "0", "Debug movement", "Allows free movement while taunting with movable taunts\nOnly works in tf2\nWIP"); void CreateMove() { static bool flswitch = false; @@ -145,22 +146,35 @@ void CreateMove() { static bool changed = false; static ConVar *pNoPush = g_ICvar->FindVar("tf_avoidteammates_pushaway"); - - //Only work if the catvar enables it - if (tauntslide_moveable) { - //Check to prevent crashing - if (CE_GOOD(LOCAL_E)) { - //If the local player is taunting - if (HasCondition(LOCAL_E)) { - logging::Info("sLIDDING "); - //Grab Camera angle - static QAngle cameraAngle; - g_IEngine->GetViewAngles(cameraAngle); - //Set userAngle = camera angles - g_pUserCmd->viewangles.y = cameraAngle[1]; - //Use silent since we dont want to prevent the player from looking around - g_pLocalPlayer->bUseSilentAngles = true; + //Tauntslide needs improvement for movement but it mostly works + IF_GAME (IsTF2()) { + //Only work if the catvar enables it + if (tauntslide_moveable) { + //Check to prevent crashing + if (CE_GOOD(LOCAL_E)) { + //If the local player is taunting + if (HasCondition(LOCAL_E)) { + if (tauntslide_debug) { + float forward = 0; + float side = 0; + if (g_pUserCmd->buttons & IN_FORWARD) forward -= 450; + if (g_pUserCmd->buttons & IN_BACK) forward += 450; + if (g_pUserCmd->buttons & IN_MOVELEFT) side -= 450; + if (g_pUserCmd->buttons & IN_MOVERIGHT) side += 450; + + g_pUserCmd->forwardmove = forward; + g_pUserCmd->sidemove = side; + } + //Grab Camera angle + static QAngle cameraAngle; + g_IEngine->GetViewAngles(cameraAngle); + + //Set userAngle = camera angles + g_pUserCmd->viewangles.y = cameraAngle[1]; + //Use silent since we dont want to prevent the player from looking around + g_pLocalPlayer->bUseSilentAngles = true; + } } } } diff --git a/src/helpers.cpp b/src/helpers.cpp index bfe74a3f..cedf3800 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -704,44 +704,48 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) { } void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) { - if (!ent) return; - //if (CE_BAD( ENTITY(ent->entindex()) )) return; - - typedef void(*SetupMoveFn)(IPrediction*, IClientEntity *, CUserCmd *, class IMoveHelper *, CMoveData *); - typedef void(*FinishMoveFn)(IPrediction*, IClientEntity *, CUserCmd*, CMoveData*); + if (!ent) return; - void **predictionVtable = *((void ***)g_IPrediction); - SetupMoveFn oSetupMove = (SetupMoveFn)(*(unsigned*)(predictionVtable + 19)); - FinishMoveFn oFinishMove = (FinishMoveFn)(*(unsigned*)(predictionVtable + 20)); + typedef void(*SetupMoveFn)(IPrediction*, IClientEntity *, CUserCmd *, class IMoveHelper *, CMoveData *); + typedef void(*FinishMoveFn)(IPrediction*, IClientEntity *, CUserCmd*, CMoveData*); - CMoveData *pMoveData = (CMoveData*)(sharedobj::client->lmap->l_addr + 0x1F69C0C); + void **predictionVtable = *((void ***)g_IPrediction); + SetupMoveFn oSetupMove = (SetupMoveFn)(*(unsigned*)(predictionVtable + 19)); + FinishMoveFn oFinishMove = (FinishMoveFn)(*(unsigned*)(predictionVtable + 20)); - float frameTime = g_GlobalVars->frametime; - float curTime = g_GlobalVars->curtime; + //CMoveData *pMoveData = (CMoveData*)(sharedobj::client->lmap->l_addr + 0x1F69C0C); + //CMoveData movedata {}; + char* object = new char[165]; + CMoveData *pMoveData = (CMoveData*)object; - CUserCmd defaultCmd; - if(ucmd == NULL) { - ucmd = &defaultCmd; - } + float frameTime = g_GlobalVars->frametime; + float curTime = g_GlobalVars->curtime; - NET_VAR(ent, 4188, CUserCmd*) = ucmd; + CUserCmd defaultCmd; + if(ucmd == NULL) { + ucmd = &defaultCmd; + } - g_GlobalVars->curtime = g_GlobalVars->interval_per_tick * NET_INT(ent, netvar.nTickBase); - g_GlobalVars->frametime = g_GlobalVars->interval_per_tick; - - *g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF; - g_IGameMovement->StartTrackPredictionErrors(reinterpret_cast(ent)); - oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData); - g_IGameMovement->ProcessMovement(reinterpret_cast(ent), pMoveData); - oFinishMove(g_IPrediction, ent, ucmd, pMoveData); - g_IGameMovement->FinishTrackPredictionErrors(reinterpret_cast(ent)); + NET_VAR(ent, 4188, CUserCmd*) = ucmd; - NET_VAR(ent, 4188, CUserCmd*) = nullptr; - *g_PredictionRandomSeed = -1; - g_GlobalVars->frametime = frameTime; - g_GlobalVars->curtime = curTime; + g_GlobalVars->curtime = g_GlobalVars->interval_per_tick * NET_INT(ent, netvar.nTickBase); + g_GlobalVars->frametime = g_GlobalVars->interval_per_tick; - return; + *g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF; + g_IGameMovement->StartTrackPredictionErrors(reinterpret_cast(ent)); + oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData); + g_IGameMovement->ProcessMovement(reinterpret_cast(ent), pMoveData); + oFinishMove(g_IPrediction, ent, ucmd, pMoveData); + g_IGameMovement->FinishTrackPredictionErrors(reinterpret_cast(ent)); + + delete[] object; + + NET_VAR(ent, 4188, CUserCmd*) = nullptr; + + g_GlobalVars->frametime = frameTime; + g_GlobalVars->curtime = curTime; + + return; }