]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
dlights using light_lev now need the PFLAG_FULLDYNAMIC flag set to operate, otherwise...
[xonotic/darkplaces.git] / sv_main.c
index 71b57193840b7f9671a234c4351134b42f86a65e..97669a558e535bfab93c5cc3e259b574eb3fc5e8 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -816,7 +816,29 @@ void SV_PrepareEntitiesForSending(void)
                cs.lightstyle = (qbyte)GETEDICTFIELDVALUE(ent, eval_style)->_float;
                cs.lightpflags = (qbyte)GETEDICTFIELDVALUE(ent, eval_pflags)->_float;
 
-               cs.specialvisibilityradius = cs.light[3];
+               if (gamemode == GAME_TENEBRAE)
+               {
+                       // tenebrae's EF_FULLDYNAMIC conflicts with Q2's EF_NODRAW
+                       if (cs.effects & 16)
+                       {
+                               cs.effects &= ~16;
+                               cs.lightpflags |= PFLAGS_FULLDYNAMIC;
+                       }
+                       // tenebrae's EF_GREEN conflicts with DP's EF_ADDITIVE
+                       if (cs.effects & 32)
+                       {
+                               cs.effects &= ~32;
+                               cs.light[0] = 0.2;
+                               cs.light[1] = 1;
+                               cs.light[2] = 0.2;
+                               cs.light[3] = 200;
+                               cs.lightpflags |= PFLAGS_FULLDYNAMIC;
+                       }
+               }
+
+               cs.specialvisibilityradius = 0;
+               if (cs.lightpflags & PFLAGS_FULLDYNAMIC)
+                       cs.specialvisibilityradius = max(cs.specialvisibilityradius, cs.light[3]);
                if (cs.glowsize)
                        cs.specialvisibilityradius = max(cs.specialvisibilityradius, cs.glowsize * 4);
                if (cs.flags & RENDER_GLOWTRAIL)