Visibility Check Problem?
I have a problem with raytrace visibility check. When players jump, it shows them as invisible. I am raytracing from the local player eye position to enemies head hitbox(not bone!). I had the same problem with bones, so it shouldn't matter.
Visibility check code:
Code:
bool IsEntityVisible(C_CSPlayer* Entity, SourceEngine::Vector EndPos)
{
Ray_t ray;
trace_t tr;
ray.Init(G::pLocal->GetEyePos(), EndPos);
CTraceFilter filter;
filter.pSkip = G::pLocal;
Interfaces::EngineTrace()->TraceRay(ray, 0x46004003, &filter, &tr);
if (tr.m_pEnt == Entity)
return true;
return false;
}
Video showing the problem:
Also, why mins and maxs does not update properly? I am getting them with NetVars, not virtual functions, could that be the problem? You can see it by the ESP lagging behind the player when they are jumping.