Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: matrix.os == 'freebsd'
uses: vmactions/freebsd-vm@v1
with:
release: "14.2"
release: "14.3"
usesh: true
prepare: |
pkg update -f
Expand Down
17 changes: 15 additions & 2 deletions src/sv_ents.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ static void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, by
usercmd_t cmd;
int hideent = 0;
int trackent = 0;
int spec_track_override = 0;
qbool hide_players = fofs_hide_players && ((eval_t *)((byte *)(client->edict)->v + fofs_hide_players))->_int;

if (fofs_hideentity)
Expand All @@ -562,6 +563,9 @@ static void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, by
trackent = 0;
}

if (client->spectator && trackent > 0 && client->spec_track > 0)
spec_track_override = trackent;

frame->sv_time = sv.time;

for (j = 0; j < MAX_CLIENTS; j++)
Expand All @@ -582,7 +586,7 @@ static void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, by
if (client != cl && hide_players)
continue;

if (trackent && cl == client)
if (trackent && cl == client && !client->spectator)
{
cl = &svs.clients[trackent - 1]; // fakenicking.

Expand All @@ -597,6 +601,12 @@ static void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, by
ent = cl->edict;
}

if (spec_track_override && j == client->spec_track - 1)
{
cl = &svs.clients[spec_track_override - 1];
ent = cl->edict;
}

// set up edicts.
if (!SV_PlayerVisibleToClient (client, j, pvs, self_ent, ent))
continue;
Expand All @@ -610,7 +620,10 @@ static void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, by
continue;

if (j == trackent - 1)
continue;
{
if (!(spec_track_override && client->spec_track == trackent))
continue;
}

if (disable_updates && ent != self_ent)
{ // Vladis
Expand Down
10 changes: 7 additions & 3 deletions src/sv_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -3625,7 +3625,9 @@ static void SV_ApplySafestrafe(client_t *cl, usercmd_t *ucmd)
if (current_dir != 0 && previous_dir != 0 &&
current_dir != previous_dir) {
// Direct direction change - enforce stop frames
cl->safestrafe.pending_frames = required_frames;
cl->safestrafe.pending_frames = required_frames - 1;
if (cl->safestrafe.pending_frames < 0)
cl->safestrafe.pending_frames = 0;
cl->safestrafe.pending_direction = current_move;
cl->safestrafe.stop_frames = 1;
ucmd->sidemove = 0;
Expand All @@ -3634,10 +3636,12 @@ static void SV_ApplySafestrafe(client_t *cl, usercmd_t *ucmd)
// Starting movement after stop
if (cl->safestrafe.stop_frames < required_frames) {
// Not enough stop frames
cl->safestrafe.pending_frames =
required_frames - cl->safestrafe.stop_frames;
cl->safestrafe.pending_direction = current_move;
cl->safestrafe.stop_frames++;
cl->safestrafe.pending_frames =
required_frames - cl->safestrafe.stop_frames;
if (cl->safestrafe.pending_frames < 0)
cl->safestrafe.pending_frames = 0;
ucmd->sidemove = 0;
}
else {
Expand Down