mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
[qw] Check tracked player name before printing
The server switching levels while the client is tracking a player (at least a server client) seems to at least temporarily clear the player slot and thus the name value pointer becomes null. This fixes the resulting segfault.
This commit is contained in:
parent
70aaafda10
commit
7a481039f8
1 changed files with 6 additions and 2 deletions
|
@ -829,8 +829,12 @@ draw_spectator (view_t *view)
|
|||
"Press [ATTACK] for AutoCamera");
|
||||
} else {
|
||||
// Sbar_DrawString (160-14*8+4,4, "SPECTATOR MODE - TRACK CAMERA");
|
||||
snprintf (st, sizeof (st), "Tracking %-.13s, [JUMP] for next",
|
||||
cl.players[spec_track].name->value);
|
||||
if (cl.players[spec_track].name) {
|
||||
snprintf (st, sizeof (st), "Tracking %-.13s, [JUMP] for next",
|
||||
cl.players[spec_track].name->value);
|
||||
} else {
|
||||
snprintf (st, sizeof (st), "Lost player, [JUMP] for next");
|
||||
}
|
||||
draw_string (view, 0, -8, st);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue