Skip to content

Commit

Permalink
fix: prevent crash on sar_trace_record in demos
Browse files Browse the repository at this point in the history
  • Loading branch information
mlugg committed Aug 6, 2022
1 parent ba15f36 commit cdc5bc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Features/PlayerTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,22 @@ void PlayerTrace::AddPoint(std::string trace_name, void *player, int slot, bool
QAngle angles;

bool grounded;
bool ducked;
if (use_client_offset) {
grounded = CE(player)->ground_entity();
ducked = CE(player)->ducked();
pos = client->GetAbsOrigin(player);
vel = client->GetLocalVelocity(player);
//eyepos = pos + client->GetViewOffset(player) + client->GetPortalLocal(player).m_vEyeOffset;
camera->GetEyePos<false>(slot, eyepos, angles);
} else {
grounded = SE(player)->ground_entity();
ducked = SE(player)->ducked();
pos = server->GetAbsOrigin(player);
vel = server->GetLocalVelocity(player);
//eyepos = pos + server->GetViewOffset(player) + server->GetPortalLocal(player).m_vEyeOffset;
camera->GetEyePos<true>(slot, eyepos, angles);
}
bool ducked = SE(player)->ducked();

HitboxList hitboxes = ConstructHitboxList(pos);

Expand Down

0 comments on commit cdc5bc5

Please sign in to comment.