Finalized changes

This commit is contained in:
julianacat 2017-06-25 02:12:35 -05:00
parent f824452eaf
commit bb60eb9377
3 changed files with 74 additions and 53 deletions

View File

@ -585,14 +585,17 @@ static const std::string list_tf2 = R"(
"Miscellaneous" [ "Miscellaneous" [
"Miscellaneous Settings" "Miscellaneous Settings"
"removecond_master" "Remove Cond" [
"removecond_value" "Remove Cond Exploit"
"removecond_key" "removecond_master"
"removecond_fire" "removecond_value"
"removecond_taunt" "removecond_key"
"removecond_bleeding" "removecond_fire"
"removecond_stun" "removecond_taunt"
"spycrab" "removecond_bleeding"
"removecond_stun"
"spycrab"
]
"Spy Alert" [ "Spy Alert" [
"Spy Alert Settings" "Spy Alert Settings"
"spyalert_enabled" "spyalert_enabled"

View File

@ -134,6 +134,7 @@ int StartSceneEvent_hooked(IClientEntity* _this, int sceneInfo, int choreoScene,
float last_bucket = 0; 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_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() { void CreateMove() {
static bool flswitch = false; static bool flswitch = false;
@ -145,22 +146,35 @@ void CreateMove() {
static bool changed = false; static bool changed = false;
static ConVar *pNoPush = g_ICvar->FindVar("tf_avoidteammates_pushaway"); static ConVar *pNoPush = g_ICvar->FindVar("tf_avoidteammates_pushaway");
//Tauntslide needs improvement for movement but it mostly works
//Only work if the catvar enables it IF_GAME (IsTF2()) {
if (tauntslide_moveable) { //Only work if the catvar enables it
//Check to prevent crashing if (tauntslide_moveable) {
if (CE_GOOD(LOCAL_E)) { //Check to prevent crashing
//If the local player is taunting if (CE_GOOD(LOCAL_E)) {
if (HasCondition<TFCond_Taunting>(LOCAL_E)) { //If the local player is taunting
logging::Info("sLIDDING "); if (HasCondition<TFCond_Taunting>(LOCAL_E)) {
//Grab Camera angle if (tauntslide_debug) {
static QAngle cameraAngle; float forward = 0;
g_IEngine->GetViewAngles(cameraAngle); float side = 0;
//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;
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;
}
} }
} }
} }

View File

@ -704,44 +704,48 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) {
} }
void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) { void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
if (!ent) return; 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*);
void **predictionVtable = *((void ***)g_IPrediction); typedef void(*SetupMoveFn)(IPrediction*, IClientEntity *, CUserCmd *, class IMoveHelper *, CMoveData *);
SetupMoveFn oSetupMove = (SetupMoveFn)(*(unsigned*)(predictionVtable + 19)); typedef void(*FinishMoveFn)(IPrediction*, IClientEntity *, CUserCmd*, CMoveData*);
FinishMoveFn oFinishMove = (FinishMoveFn)(*(unsigned*)(predictionVtable + 20));
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; //CMoveData *pMoveData = (CMoveData*)(sharedobj::client->lmap->l_addr + 0x1F69C0C);
float curTime = g_GlobalVars->curtime; //CMoveData movedata {};
char* object = new char[165];
CMoveData *pMoveData = (CMoveData*)object;
CUserCmd defaultCmd; float frameTime = g_GlobalVars->frametime;
if(ucmd == NULL) { float curTime = g_GlobalVars->curtime;
ucmd = &defaultCmd;
}
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); NET_VAR(ent, 4188, CUserCmd*) = ucmd;
g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;
*g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF;
g_IGameMovement->StartTrackPredictionErrors(reinterpret_cast<CBasePlayer*>(ent));
oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData);
g_IGameMovement->ProcessMovement(reinterpret_cast<CBasePlayer*>(ent), pMoveData);
oFinishMove(g_IPrediction, ent, ucmd, pMoveData);
g_IGameMovement->FinishTrackPredictionErrors(reinterpret_cast<CBasePlayer*>(ent));
NET_VAR(ent, 4188, CUserCmd*) = nullptr; g_GlobalVars->curtime = g_GlobalVars->interval_per_tick * NET_INT(ent, netvar.nTickBase);
*g_PredictionRandomSeed = -1; g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;
g_GlobalVars->frametime = frameTime;
g_GlobalVars->curtime = curTime;
return; *g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF;
g_IGameMovement->StartTrackPredictionErrors(reinterpret_cast<CBasePlayer*>(ent));
oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData);
g_IGameMovement->ProcessMovement(reinterpret_cast<CBasePlayer*>(ent), pMoveData);
oFinishMove(g_IPrediction, ent, ucmd, pMoveData);
g_IGameMovement->FinishTrackPredictionErrors(reinterpret_cast<CBasePlayer*>(ent));
delete[] object;
NET_VAR(ent, 4188, CUserCmd*) = nullptr;
g_GlobalVars->frametime = frameTime;
g_GlobalVars->curtime = curTime;
return;
} }