mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
BHit_f light cleanup
This commit is contained in:
parent
2675fca219
commit
addf815873
@ -933,37 +933,37 @@ void BHit_f(const CCommand& args)
|
|||||||
if (args.ArgC() != 9)
|
if (args.ArgC() != 9)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (bhit_enable->GetBool() && sv_visualizetraces->GetBool())
|
if (!bhit_enable->GetBool() && !sv_visualizetraces->GetBool())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vector3D vecAbsStart;
|
||||||
|
Vector3D vecAbsEnd;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; ++i)
|
||||||
|
vecAbsStart[i] = atof(args[i + 4]);
|
||||||
|
|
||||||
|
QAngle vecBulletAngles;
|
||||||
|
for (int i = 0; i < 2; ++i)
|
||||||
|
vecBulletAngles[i] = atof(args[i + 7]);
|
||||||
|
|
||||||
|
vecBulletAngles.z = 180.f; // Flipped axis.
|
||||||
|
AngleVectors(vecBulletAngles, &vecAbsEnd);
|
||||||
|
|
||||||
|
static char szBuf[2048]; // Render physics trace.
|
||||||
|
snprintf(szBuf, sizeof(szBuf), "drawline %g %g %g %g %g %g",
|
||||||
|
vecAbsStart.x, vecAbsStart.y, vecAbsStart.z,
|
||||||
|
vecAbsStart.x + vecAbsEnd.x * MAX_COORD_RANGE,
|
||||||
|
vecAbsStart.y + vecAbsEnd.y * MAX_COORD_RANGE,
|
||||||
|
vecAbsStart.z + vecAbsEnd.z * MAX_COORD_RANGE);
|
||||||
|
Cbuf_AddText(Cbuf_GetCurrentPlayer(), szBuf, cmd_source_t::kCommandSrcCode);
|
||||||
|
|
||||||
|
if (bhit_abs_origin->GetBool())
|
||||||
{
|
{
|
||||||
Vector3D vecAbsStart;
|
const int iEnt = atof(args[2]);
|
||||||
Vector3D vecAbsEnd;
|
if (const IClientEntity* pEntity = g_pClientEntityList->GetClientEntity(iEnt))
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i)
|
|
||||||
vecAbsStart[i] = atof(args[i + 4]);
|
|
||||||
|
|
||||||
QAngle vecBulletAngles;
|
|
||||||
for (int i = 0; i < 2; ++i)
|
|
||||||
vecBulletAngles[i] = atof(args[i + 7]);
|
|
||||||
|
|
||||||
vecBulletAngles.z = 180.f; // Flipped axis.
|
|
||||||
AngleVectors(vecBulletAngles, &vecAbsEnd);
|
|
||||||
|
|
||||||
static char szBuf[2048]; // Render physics trace.
|
|
||||||
snprintf(szBuf, sizeof(szBuf), "drawline %g %g %g %g %g %g",
|
|
||||||
vecAbsStart.x, vecAbsStart.y, vecAbsStart.z,
|
|
||||||
vecAbsStart.x + vecAbsEnd.x * MAX_COORD_RANGE,
|
|
||||||
vecAbsStart.y + vecAbsEnd.y * MAX_COORD_RANGE,
|
|
||||||
vecAbsStart.z + vecAbsEnd.z * MAX_COORD_RANGE);
|
|
||||||
Cbuf_AddText(Cbuf_GetCurrentPlayer(), szBuf, cmd_source_t::kCommandSrcCode);
|
|
||||||
|
|
||||||
if (bhit_abs_origin->GetBool())
|
|
||||||
{
|
{
|
||||||
const int iEnt = atof(args[2]);
|
g_pDebugOverlay->AddSphereOverlay( // Render a debug sphere at the client's predicted entity origin.
|
||||||
if (const IClientEntity* pEntity = g_pClientEntityList->GetClientEntity(iEnt))
|
pEntity->GetAbsOrigin(), 10.f, 8, 6, 20, 60, 255, 0, sv_visualizetraces_duration->GetFloat());
|
||||||
{
|
|
||||||
g_pDebugOverlay->AddSphereOverlay( // Render a debug sphere at the client's predicted entity origin.
|
|
||||||
pEntity->GetAbsOrigin(), 10.f, 8, 6, 20, 60, 255, 0, sv_visualizetraces_duration->GetFloat());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // !DEDICATED
|
#endif // !DEDICATED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user