From 982397739159eec1df93602ed6a68ce0eeba6039 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 22 Aug 2021 19:05:12 +0100 Subject: [PATCH] Add support for zhlt_lightflags Support zhlt lightflags for shadow casting Signed-off-by: Joshua Ashton --- tools/vmap/bspfile_abstract.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tools/vmap/bspfile_abstract.c b/tools/vmap/bspfile_abstract.c index ee803b2..d3c593d 100644 --- a/tools/vmap/bspfile_abstract.c +++ b/tools/vmap/bspfile_abstract.c @@ -1063,18 +1063,24 @@ void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castS /* get cast shadows */ if ( castShadows != NULL ) { - value = ValueForKey( ent, "_castShadows" ); - if ( value[ 0 ] == '\0' ) { - value = ValueForKey( ent, "_cs" ); + value = ValueForKey( ent, "zhlt_lightflags" ); + if ( value && value[ 0 ] != '\0' ) { + *castShadows = atoi( value ) & 0x2; } - if ( value[ 0 ] == '\0' ) { - value = ValueForKey( ent2, "_castShadows" ); - } - if ( value[ 0 ] == '\0' ) { - value = ValueForKey( ent2, "_cs" ); - } - if ( value[ 0 ] != '\0' ) { - *castShadows = atoi( value ); + else { + value = ValueForKey( ent, "_castShadows" ); + if ( value[ 0 ] == '\0' ) { + value = ValueForKey( ent, "_cs" ); + } + if ( value[ 0 ] == '\0' ) { + value = ValueForKey( ent2, "_castShadows" ); + } + if ( value[ 0 ] == '\0' ) { + value = ValueForKey( ent2, "_cs" ); + } + if ( value[ 0 ] != '\0' ) { + *castShadows = atoi( value ); + } } }