From ff1d4efb048a340193b6f36757b1aac743a706a8 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 23 Sep 2008 08:42:38 +0000 Subject: fixed rendering of the nameplates --- src/game/client/components/nameplates.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/game/client/components/nameplates.cpp b/src/game/client/components/nameplates.cpp index 82a15487..fdceffaf 100644 --- a/src/game/client/components/nameplates.cpp +++ b/src/game/client/components/nameplates.cpp @@ -44,23 +44,21 @@ void NAMEPLATES::on_render() { if (!config.cl_nameplates) return; - - int num = snap_num_items(SNAP_CURRENT); - for(int i = 0; i < num; i++) + + for(int i = 0; i < MAX_CLIENTS; i++) { - SNAP_ITEM item; - const void *data = snap_get_item(SNAP_CURRENT, i, &item); + // only render active characters + if(!gameclient.snap.characters[i].active) + continue; - if(item.type == NETOBJTYPE_CHARACTER) - { - const void *prev = snap_find_item(SNAP_PREV, item.type, item.id); - const void *info = snap_find_item(SNAP_CURRENT, NETOBJTYPE_PLAYER_INFO, item.id); + const void *info = snap_find_item(SNAP_CURRENT, NETOBJTYPE_PLAYER_INFO, i); - if(prev && info) - render_nameplate( - (const NETOBJ_CHARACTER *)prev, - (const NETOBJ_CHARACTER *)data, - (const NETOBJ_PLAYER_INFO *)info); + if(info) + { + render_nameplate( + &gameclient.snap.characters[i].prev, + &gameclient.snap.characters[i].cur, + (const NETOBJ_PLAYER_INFO *)info); } } } -- cgit 1.4.1