Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Remove const just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
notgoodusename committed Mar 5, 2023
1 parent aa6760f commit 4d670e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions Osiris/Hacks/Ragebot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ void Ragebot::run(UserCmd* cmd) noexcept

for (const auto& target : enemies)
{
const auto entity{ interfaces->entityList->getEntity(target.id) };
const auto player = Animations::getPlayer(target.id);
const int minDamage = std::clamp(std::clamp(config->minDamageOverrideKey.isActive() ? cfg[weaponIndex].minDamageOverride : cfg[weaponIndex].minDamage, 0, target.health), 0, activeWeapon->getWeaponData()->damage);

const auto& backupBoneCache = entity->getBoneCache().memory;
const auto& backupMins = entity->getCollideable()->obbMins();
const auto& backupMaxs = entity->getCollideable()->obbMaxs();
const auto& backupOrigin = entity->getAbsOrigin();
const auto& backupAbsAngle = entity->getAbsAngle();
auto entity{ interfaces->entityList->getEntity(target.id) };
auto player = Animations::getPlayer(target.id);
int minDamage = std::clamp(std::clamp(config->minDamageOverrideKey.isActive() ? cfg[weaponIndex].minDamageOverride : cfg[weaponIndex].minDamage, 0, target.health), 0, activeWeapon->getWeaponData()->damage);

matrix3x4* backupBoneCache = entity->getBoneCache().memory;
Vector backupMins = entity->getCollideable()->obbMins();
Vector backupMaxs = entity->getCollideable()->obbMaxs();
Vector backupOrigin = entity->getAbsOrigin();
Vector backupAbsAngle = entity->getAbsAngle();

for (int cycle = 0; cycle < 2; cycle++)
{
Expand Down
18 changes: 9 additions & 9 deletions Osiris/Hacks/Triggerbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ void Triggerbot::run(UserCmd* cmd) noexcept
|| !entity->isOtherEnemy(localPlayer.get()) && !cfg.friendlyFire || entity->gunGameImmunity())
continue;

const auto player = Animations::getPlayer(i);
auto player = Animations::getPlayer(i);
if (!player.gotMatrix)
continue;

auto backupBoneCache = entity->getBoneCache().memory;
auto backupMins = entity->getCollideable()->obbMins();
auto backupMaxs = entity->getCollideable()->obbMaxs();
auto backupOrigin = entity->getAbsOrigin();
auto backupAbsAngle = entity->getAbsAngle();
matrix3x4* backupBoneCache = entity->getBoneCache().memory;
Vector backupMins = entity->getCollideable()->obbMins();
Vector backupMaxs = entity->getCollideable()->obbMaxs();
Vector backupOrigin = entity->getAbsOrigin();
Vector backupAbsAngle = entity->getAbsAngle();

memcpy(entity->getBoneCache().memory, player.matrix.data(), std::clamp(entity->getBoneCache().size, 0, MAXSTUDIOBONES) * sizeof(matrix3x4));
memory->setAbsOrigin(entity, player.origin);
Expand Down Expand Up @@ -177,7 +177,7 @@ void Triggerbot::run(UserCmd* cmd) noexcept
if (!config->backtrack.enabled)
continue;

const auto records = Animations::getBacktrackRecords(entity->index());
auto records = Animations::getBacktrackRecords(entity->index());
if (!records || records->empty())
continue;

Expand All @@ -190,7 +190,7 @@ void Triggerbot::run(UserCmd* cmd) noexcept
continue;

const auto angle = AimbotFunction::calculateRelativeAngle(startPos, records->at(i).origin, cmd->viewangles + aimPunch);
const auto fov = std::hypotf(angle.x, angle.y);
const auto fov = std::hypotf(angle.x, angle.y);
if (fov < bestFov) {
bestFov = fov;
bestTick = i;
Expand All @@ -200,7 +200,7 @@ void Triggerbot::run(UserCmd* cmd) noexcept
if (bestTick <= -1)
continue;

const auto record = records->at(bestTick);
auto record = records->at(bestTick);

backupBoneCache = entity->getBoneCache().memory;
backupMins = entity->getCollideable()->obbMins();
Expand Down

0 comments on commit 4d670e2

Please sign in to comment.