kira yoshikage
-
Автор темы
- #1
C++:
void DoJumpBug()
{
if (!g_Settings.misc.bJumpBug)
return;
C_BaseEntity* local = g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer());
float max_radias = D3DX_PI * 2;
float step = max_radias / 128;
float xThick = 23;
if (g_Settings.misc.bJumpBug && g_pInputSystem->IsButtonDown(g_Settings.misc.bJumpKey) && (local->GetFlags() & (1 << 0))) {
g_Settings.misc.bBhopEnabled = false;
int screenWidth, screenHeight;
g_pEngine->GetScreenSize(screenWidth, screenHeight);
if (unduck) {
g_Settings.bDidJump = false;
pCmd->buttons &= ~IN_DUCK; // duck
pCmd->buttons |= IN_JUMP; // jump
unduck = false;
}
Vector pos = local->GetOrigin();
for (float a = 0.f; a < max_radias; a += step) {
Vector pt;
pt.x = (xThick * cos(a)) + pos.x;
pt.y = (xThick * sin(a)) + pos.y;
pt.z = pos.z;
Vector pt2 = pt;
pt2.z -= 6;
trace_t fag;
Ray_t ray;
ray.Init(pt, pt2);
CTraceFilter flt;
flt.pSkip = local;
g_pEngineTrace->TraceRay(ray, MASK_SOLID_BRUSHONLY, &flt, &fag);
if (fag.fraction != 1.f && fag.fraction != 0.f) {
g_Settings.bDidJump = true;
pCmd->buttons |= IN_DUCK; // duck
pCmd->buttons &= ~IN_JUMP; // jump
unduck = true;
}
}
for (float a = 0.f; a < max_radias; a += step) {
Vector pt;
pt.x = ((xThick - 2.f)* cos(a)) + pos.x;
pt.y = ((xThick - 2.f) * sin(a)) + pos.y;
pt.z = pos.z;
Vector pt2 = pt;
pt2.z -= 6;
trace_t fag;
Ray_t ray;
ray.Init(pt, pt2);
CTraceFilter flt;
flt.pSkip = local;
g_pEngineTrace->TraceRay(ray, MASK_SOLID_BRUSHONLY, &flt, &fag);
if (fag.fraction != 1.f && fag.fraction != 0.f) {
g_Settings.bDidJump = true;
pCmd->buttons |= IN_DUCK; // duck
pCmd->buttons &= ~IN_JUMP; // jump
unduck = true;
}
}
for (float a = 0.f; a < max_radias; a += step) {
Vector pt;
pt.x = ((xThick - 20.f)* cos(a)) + pos.x;
pt.y = ((xThick - 20.f) * sin(a)) + pos.y;
pt.z = pos.z;
Vector pt2 = pt;
pt2.z -= 6;
trace_t fag;
Ray_t ray;
ray.Init(pt, pt2);
CTraceFilter flt;
flt.pSkip = local;
g_pEngineTrace->TraceRay(ray, MASK_SOLID_BRUSHONLY, &flt, &fag);
if (fag.fraction != 1.f && fag.fraction != 0.f) {
g_Settings.bDidJump = true;
pCmd->buttons |= IN_DUCK; // duck
pCmd->buttons &= ~IN_JUMP; // jump
unduck = true;
}
}
}
else { g_Settings.misc.bBhopEnabled = true; }
}
нашёл на uc