From 1c5c6582acf5c4b410317413d0fa2da1a167e233 Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed, 23 May 2007 22:07:18 +0000
Subject: [PATCH] changed DP_SV_MODELFLAGS_AS_EFFECTS extension, now using any
 of the MF_ flags will override the model's flags added EF_NOMODELFLAGS effect
 to disable model flags without replacing them with anything new

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7354 d7cf8633-e32d-0410-b094-e92efae38249
---
 cl_main.c  | 4 +++-
 protocol.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cl_main.c b/cl_main.c
index 12704f50..4be3ee7b 100644
--- a/cl_main.c
+++ b/cl_main.c
@@ -949,7 +949,9 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
 	if (e->render.model)
 	{
 		// models can set flags such as EF_ROCKET
-		e->render.effects |= e->render.model->effects;
+		// this 0xFF800000 mask is EF_NOMODELFLAGS plus all the higher EF_ flags such as EF_ROCKET
+		if (!(e->render.effects & 0xFF800000))
+			e->render.effects |= e->render.model->effects;
 		// if model is alias or this is a tenebrae-like dlight, reverse pitch direction
 		if (e->render.model->type == mod_alias)
 			angles[0] = -angles[0];
diff --git a/protocol.h b/protocol.h
index 30905740..77d38542 100644
--- a/protocol.h
+++ b/protocol.h
@@ -64,7 +64,7 @@ void Protocol_Names(char *buffer, size_t buffersize);
 #define EF_UNUSED20				1048576
 #define EF_UNUSED21				2197152
 #define EF_LOWPRECISION			4194304		// LordHavoc: entity is low precision (integer coordinates) to save network bandwidth  (serverside only)
-#define EF_UNUSED23				8388608
+#define EF_OVERRIDEMODELFLAGS	8388608		// indicates the model's .effects should be ignored (allows overriding them)
 #define EF_ROCKET				16777216	// leave a trail
 #define EF_GRENADE				33554432	// leave a trail
 #define EF_GIB					67108864	// leave a trail
-- 
2.39.5