Skip to content

Commit

Permalink
Add disable interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
degeneratehyperbola committed Jun 8, 2021
1 parent 71c7134 commit d2d6481
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
6 changes: 4 additions & 2 deletions NEPS/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,9 @@ static void from_json(const json &j, Config::Misc &m)
read(j, "Fix movement", m.fixMovement);
read(j, "Fix animations", m.fixAnimation);
read(j, "Disable model occlusion", m.disableModelOcclusion);
read(j, "Unlock invertory", m.unlockInvertory);
read(j, "Disable interpolation", m.disableInterp);
read(j, "Resolver", m.desyncResolver);
read(j, "Unlock invertory", m.unlockInvertory);
read(j, "Disable HUD blur", m.disablePanoramablur);
read<value_t::object>(j, "Prepare revolver", m.prepareRevolver);
read<value_t::object>(j, "Purchase list", m.purchaseList);
Expand Down Expand Up @@ -1121,8 +1122,9 @@ static void to_json(json &j, const Config::Misc &o)
WRITE("Fix movement", fixMovement);
WRITE("Fix animations", fixAnimation);
WRITE("Disable model occlusion", disableModelOcclusion);
WRITE("Unlock invertory", unlockInvertory);
WRITE("Disable interpolation", disableInterp);
WRITE("Resolver", desyncResolver);
WRITE("Unlock invertory", unlockInvertory);
WRITE("Disable HUD blur", disablePanoramablur);
WRITE("Prepare revolver", prepareRevolver);
WRITE("Quick healthshot key", quickHealthshotKey);
Expand Down
3 changes: 2 additions & 1 deletion NEPS/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ class Config
bool fixMovement = true;
bool fixAnimation = true;
bool disableModelOcclusion = true;
bool unlockInvertory = false;
bool disableInterp = false;
bool desyncResolver;
bool unlockInvertory = false;
bool disablePanoramablur = false;
struct PreserveKillfeed
{
Expand Down
1 change: 1 addition & 0 deletions NEPS/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,7 @@ void GUI::renderMiscWindow(bool contentOnly) noexcept
ImGui::Checkbox("Fix movement", &config->misc.fixMovement);
ImGui::Checkbox("Sync client animations", &config->misc.fixAnimation);
ImGui::Checkbox("Disable model occlusion", &config->misc.disableModelOcclusion);
ImGui::Checkbox("Disable interpolation", &config->misc.disableInterp);
ImGui::Checkbox("Desync resolver", &config->misc.desyncResolver);

ImGui::NextColumn();
Expand Down
20 changes: 13 additions & 7 deletions NEPS/Hacks/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,25 +976,31 @@ void Misc::antiAfkKick(UserCmd *cmd) noexcept
cmd->buttons |= 1 << 26;
}

void Misc::fixAnimationLOD(FrameStage stage) noexcept
void Misc::tweakNonLocalPlayerAnim(FrameStage stage) noexcept
{
if (config->misc.fixAnimationLOD && stage == FrameStage::RENDER_START)
if (stage == FrameStage::RENDER_START)
{
if (!localPlayer)
return;

if (!config->misc.fixAnimationLOD && !config->misc.disableInterp)
return;

for (int i = 1; i <= interfaces->engine->getMaxClients(); i++)
{
Entity *entity = interfaces->entityList->getEntity(i);

if (!entity || entity == localPlayer.get() || entity->isDormant() || !entity->isAlive()) continue;

*reinterpret_cast<int *>(entity + 0xA28) = 0;
*reinterpret_cast<int *>(entity + 0xA30) = memory->globalVars->framecount;
if (config->misc.fixAnimationLOD)
{
*reinterpret_cast<int *>(entity + 0xA28) = 0;
*reinterpret_cast<int *>(entity + 0xA30) = memory->globalVars->framecount;
}

//if (auto varMap = entity->getVarMap())
// for (int j = 0; j < varMap->entries.size; j++)
// varMap->entries[j].needsToInterpolate = 0;
if (auto varMap = entity->getVarMap(); varMap && config->misc.disableInterp)
for (int j = 0; j < varMap->entries.size; j++)
varMap->entries[j].needsToInterpolate = 0;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NEPS/Hacks/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Misc
void killMessage(GameEvent &event) noexcept;
void fixMovement(UserCmd *cmd, float yaw) noexcept;
void antiAfkKick(UserCmd *cmd) noexcept;
void fixAnimationLOD(FrameStage stage) noexcept;
void tweakNonLocalPlayerAnim(FrameStage stage) noexcept;
void autoPistol(UserCmd *cmd) noexcept;
void autoReload(UserCmd *cmd) noexcept;
void revealRanks(UserCmd *cmd) noexcept;
Expand Down
2 changes: 1 addition & 1 deletion NEPS/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static void __stdcall frameStageNotify(FrameStage stage) noexcept
Visuals::playerModel(stage);
Visuals::disablePostProcessing(stage);
Visuals::removeVisualRecoil(stage);
Misc::fixAnimationLOD(stage);
Misc::tweakNonLocalPlayerAnim(stage);
Backtrack::update(stage);
SkinChanger::run(stage);
}
Expand Down

0 comments on commit d2d6481

Please sign in to comment.