From 3c79565a50d819db105c1960cb0c7404a9be0032 Mon Sep 17 00:00:00 2001 From: MotoLegacy Date: Thu, 26 Dec 2024 17:11:50 -0500 Subject: [PATCH] CLIENT: Directly grab the name infokey for players in Broadcasts --- source/client/hud.qc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/client/hud.qc b/source/client/hud.qc index bbc5eb3..65ad23a 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1483,9 +1483,14 @@ void() HUD_Powerups = void() HUD_Broadcast = { + // broadcast_num refers to the playernum of the client. This + // does NOT correspond to player key indexes, so we need to + // grab the player with the matching playernum and use infokeys. + entity player_target = findfloat(world, playernum, broadcast_num); + string broadcast_name = infokey(player_target, INFOKEY_P_NAME); + string broadcast_msg = ""; - string broadcast_name = getplayerkeyvalue(broadcast_num - 1, "name"); - + switch(broadcast_type) { case CSQC_BROADCAST_PLAYERDOWNED: broadcast_msg = strcat(broadcast_name, " needs to be revived");