From a378e80dbf4229ca4f6edcbe92b1daaa698f2191 Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 23 Apr 2026 01:24:34 -0500 Subject: [PATCH] Remove useless trap_R_AddRefEntityToScene return value It returns how many entities have been added to the current scene, but there is nothing useful the cgame can do with this number. All the APIs with entity id require adding the entity to the cache to get an id, not to the scene. --- src/shared/client/cg_api.cpp | 8 +------- src/shared/client/cg_api.h | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/shared/client/cg_api.cpp b/src/shared/client/cg_api.cpp index da4c679f54..c530c58dd6 100644 --- a/src/shared/client/cg_api.cpp +++ b/src/shared/client/cg_api.cpp @@ -295,14 +295,9 @@ void trap_R_ClearScene() cmdBuffer.SendMsg(); } -/* HACK: We need the entityNum to get the correct positions for entities that need to be attached to another entity's bone -This must be equal to the r_numEntities in engine at the time of adding the entity */ -static int entityNum; -int trap_R_AddRefEntityToScene( const refEntity_t *re ) +void trap_R_AddRefEntityToScene( const refEntity_t *re ) { cmdBuffer.SendMsg(*re); - entityNum++; - return entityNum - 1; } void trap_R_SyncRefEntities( const std::vector& ents ) { @@ -380,7 +375,6 @@ void trap_R_AddLightToScene( const vec3_t origin, float radius, float intensity, void trap_R_RenderScene( const refdef_t *fd ) { - entityNum = 0; cmdBuffer.SendMsg(*fd); } diff --git a/src/shared/client/cg_api.h b/src/shared/client/cg_api.h index 69a2087035..bce1150daa 100644 --- a/src/shared/client/cg_api.h +++ b/src/shared/client/cg_api.h @@ -65,7 +65,7 @@ qhandle_t trap_R_RegisterModel( const char *name ); qhandle_t trap_R_RegisterSkin( const char *name ); qhandle_t trap_R_RegisterShader( const char *name, int flags ); void trap_R_ClearScene(); -int trap_R_AddRefEntityToScene( const refEntity_t *re ); +void trap_R_AddRefEntityToScene( const refEntity_t *re ); void trap_R_SyncRefEntities( const std::vector& ents ); std::vector trap_R_SyncLerpTags( const std::vector& lerpTags ); void trap_R_AddPolyToScene( qhandle_t hShader, int numVerts, const polyVert_t *verts );