From aaaaa156a9dbb7f60bbeca3091b8efabdef13994 Mon Sep 17 00:00:00 2001 From: Ensiform Date: Wed, 4 Sep 2024 10:29:28 -0500 Subject: [PATCH] Fix trap_LinkEntity Added support to show actual classname of entities in warning and where it is linked at for debugging. --- code/game/g_local.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/g_local.h b/code/game/g_local.h index c363ed4..f747015 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -1384,7 +1384,8 @@ qboolean trap_InPVS( const vec3_t p1, const vec3_t p2 ); qboolean trap_InPVSIgnorePortals( const vec3_t p1, const vec3_t p2 ); void trap_AdjustAreaPortalState( gentity_t *ent, qboolean open ); qboolean trap_AreasConnected( int area1, int area2 ); -void trap_LinkEntity( gentity_t *ent ); +void trap_LinkEntityExt( gentity_t *ent, const char *file, int line ); +#define trap_LinkEntity( ent ) trap_LinkEntityExt( ent, __FILE__, __LINE__ ) void trap_UnlinkEntity( gentity_t *ent ); int trap_EntitiesInBox( const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount ); qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );