like amiri in my mind
Пользователь
-
Автор темы
- #1
Возможно вронг.
Код:
void c_rage_bot::hit_scan(_BYTE* this, _DWORD* hitboxes, int data.point, int a4, char optimized_hboxes) {
auto hit_boxes = get_hitboxes(v90, (int)&v64, (int)hitboxes, optimized_hboxes);
//hitboxes empty - get outta here skip ragebot
if (!hit_boxes || !globals::cur_wep)
return;
//validating weapon dont care how we do it
if (!globals::cur_wep->is_aim)
return;
//init safe features
auto v70 = (unsigned __int8)get_keybind_state(3)
|| force_safe_points[hitboxes[1]]
|| enable_max_misses[globals::cur_wep]
&& shots_fired[player->index] >= max_misses[player->index];
auto use_safe_optimized_features = v70;
auto best_dmg = 0;
//get min dmg to hit
auto v7 = (int*)scale_health((char*)*hitboxes);
auto invisible_dmg = get_minimum_dmg(0, *v7);
auto v8 = (int*)scale_health((char*)*hitboxes);
auto visible_dmg = get_minimum_dmg(1, *v8);
/*
some part with chosing needed hitboxes that i probably skipped
*/
if (!result_hitboxes) //result hitboxes that were chosen at the stage below
return;
//get points
//delete
if (points.empty())
break;
for (auto it = points.begin(); it != points.end(); ++it)
{
// **** calculating fov betwen points stuff
if (fov_between_points < 5.0f)
{
points.erase(it);
break;
}
}
//iterate hitboxes
if (!optimized_hboxes && v92 && hitboxes.at(i) < 2 || hitboxes.at(i) > 6)){
v92 = 0;
if (force_baim[globals::cur_wep])
break;
if ((unsigned __int8)get_keybind_state(22))
break;
curr_scaled_health = (_DWORD*)scale_health((char*)*hitboxes);
if (best_dmg >= *curr_scaled_health
|| !*(_DWORD*)sub_10009300((char*)*hitboxes)
&& *(_WORD*)item_def_index(*(_DWORD*)(globals + 13852)) == 40
&& best_dmg >= 1)
{
//we chose point so we break out of cycle
break;
}
if (byte_105A4611[100 * *(_DWORD*)(globals + 132)] && mb_best_dmg >= 1) //if optimized and found sufficent dmg
break;
}
if (optimized_hboxes
|| !prefer_safe_points[globals::cur_wep] && !use_safe_optimized_features
|| *(float*)(data.point + 20) == 0.0
|| *(float*)(v86 + 20) <= *(float*)(data.point + 20))
{
v42 = (void*)sub_100156A0();
v43 = *hitboxes;
get_autowall_dmg(v42, (int)&v73, a4, v86, v43);
if (v73)
{
if (calculated_dmg >= 1 && (is_visible || byte_105A458C))
{
if (optimized_hboxes || (v18 = sub_1005B5A0(&v76), v18 == sub_1005B5A0((_DWORD*)(v86 + 12)) /*check if we got hitbox from cfg and its equal to scanning hitbox*/))
{
cur_min_dmg = is_visible ? visible_dmg : invisible_dmg;
cur_dmg = cur_min_dmg;
if (calculated_dmg >= cur_min_dmg && calculated_dmg >= mb_best_dmg)
{
if (!optimized_hboxes && !v90[1662036])
v90[1662036] = 1;
if (optimized_hboxes || !use_safe_optimized_features || *(float*)(v86 + 20) != 0.0 /*hitbox != 0.f*/)
{
//write final data
best_dmg = calculated_dmg;
sub_10059280((_DWORD*)data.point, v86);
*(_BYTE*)(data.point + 24) = is_visible;
*(_DWORD*)(data.point + 28) = calculated_dmg;
*(_DWORD*)(data.point + 32) = v76; //write hitbox data to final point
if (optimized_hboxes) // if(optimized)
// return
{
//return as soon as we found everything
LOBYTE(ret) = 0;
sub_1005E7E0(&v82);
ret = -1;
sub_10006440(&v64);
return;
}
}
}
}
}
}
}
}