❓ resolver is broken... want help!
Code:
if (pLocal->IsAlive())
{
CTickRecord *Ticks;
Ticks = new CTickRecord();
CResolver* Reso = new CResolver();
for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
{
IClientEntity *Entity = Interfaces::EntList->GetClientEntity(i);
Reso->Resolve();
}
if (Interfaces::Globals->tickcount)
{
for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
{
IClientEntity *Entity = Interfaces::EntList->GetClientEntity(i);
QAngle ang = Entity->GetEyeAnglesXY();
float lby = Entity->GetLowerBodyYaw();
float simtime = Entity->GetSimulationTime();
float tick = Ticks->tickcount;
Reso->StoreVars(ang, lby, simtime, tick);
}
}
}
Code:
void CResolver::StoreVars(QAngle ang, float lby, float simtime, float tick) {
CTickRecord *Ticks;
Ticks = new CTickRecord();
for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
{
IClientEntity *ent = Interfaces::EntList->GetClientEntity(i);
if (m_arrInfos.at(ent->GetIndex()).m_sRecords.size() >= static_cast<size_t>(Ticks->tickcount))
m_arrInfos.at(ent->GetIndex()).m_sRecords.pop_back();
m_arrInfos.at(ent->GetIndex()).m_sRecords.push_front(CTickRecord(ent));
}
}
Code:
void CResolver::Resolve() {
for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
{
IClientEntity *ent = Interfaces::EntList->GetClientEntity(i);
vec_t eyeanglesy = ent->GetEyeAnglesXY().y;
CBacktracking* Backtracking;
auto cur = m_arrInfos.at(ent->GetIndex()).m_sRecords;
if (cur.size() < 2)
return;
if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 0)
return;
else if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 1) {
eyeanglesy = cur.front().m_flLowerBodyYawTarget;
}
else if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 2) {
eyeanglesy = LBYDelta(cur.front());
}
else if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 3) {
if (cur.size() <= 1)
return;
float tickdif = static_cast<float>(cur.front().tickcount - cur.at(1).tickcount);
float lbydif = GetDelta(cur.front().m_flLowerBodyYawTarget, cur.at(1).m_flLowerBodyYawTarget);
float ntickdif = static_cast<float>(Interfaces::Globals->tickcount - cur.front().tickcount);
eyeanglesy = (lbydif / tickdif) * ntickdif;
}
else if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 4) {
eyeanglesy = ent->GetEyeAnglesXY().y - GetDeltaByComparingTicks(cur);
}
else if (Menu::Window.RageBotTab.AccuracyResolver.GetIndex() == 5) {
// if (Backtracking->CanBacktrackShot(GetShotRecord(ent)))
// m_arrInfos.at(ent->GetIndex()).m_sRecords.erase(std::remove(m_arrInfos.at(ent->GetIndex()).m_sRecords.begin(), m_arrInfos.at(ent->GetIndex()).m_sRecords.end(), GetShotRecord(ent)), m_arrInfos.at(ent->GetIndex()).m_sRecords.end());
/*else*/ if (IsEntityMoving(ent))
eyeanglesy = ent->GetLowerBodyYaw();
else if (HasStaticRealAngle(cur))
eyeanglesy = (cur.front().m_flLowerBodyYawTarget) + (rand() % (int) 0.f, 1.f > 0.5f ? 10 : -10);
else if (HasStaticYawDifference(cur))
eyeanglesy = ent->GetEyeAnglesXY().y - (cur.front().m_angEyeAnglesXY.y - cur.front().m_flLowerBodyYawTarget);
else if (HasSteadyDifference(cur)) {
float tickdif = static_cast<float>(cur.front().tickcount - cur.at(1).tickcount);
float lbydif = GetDelta(cur.front().m_flLowerBodyYawTarget, cur.at(1).m_flLowerBodyYawTarget);
float ntickdif = static_cast<float>(Interfaces::Globals->tickcount - cur.front().tickcount);
eyeanglesy = (lbydif / tickdif) * ntickdif;
}
else if (DeltaKeepsChanging(cur))
eyeanglesy = ent->GetEyeAnglesXY().y - GetDeltaByComparingTicks(cur);
else if (LBYKeepsChanging(cur))
eyeanglesy = GetLBYByComparingTicks(cur);
else
eyeanglesy = ent->GetEyeAnglesXY().y + 180;
}
}
}
- - - Updated - - -
tell me if you need more info