about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-23 08:42:38 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-23 08:42:38 +0000
commitff1d4efb048a340193b6f36757b1aac743a706a8 (patch)
tree4d2800381282a70e3d438ff4ed1e289301e5130f /src/game/client/components
parentf7be203d398071304a4c808d691c0cd43844f6f6 (diff)
downloadzcatch-ff1d4efb048a340193b6f36757b1aac743a706a8.tar.gz
zcatch-ff1d4efb048a340193b6f36757b1aac743a706a8.zip
fixed rendering of the nameplates
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/nameplates.cpp26
1 files changed, 12 insertions, 14 deletions
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);
 		}
 	}
 }