]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
r_shadows: use the parent entity's light direction for shadowing attached entities...
[xonotic/darkplaces.git] / cl_main.c
index dbb23b4a887be87d62ca7d43d8fbb57ee53fd54e..39f46ab2399d1ab501395088ce46f653a351da59 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -881,7 +881,10 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
        e->render.flags = e->state_current.flags;
        e->render.effects = e->state_current.effects;
        VectorScale(e->state_current.colormod, (1.0f / 32.0f), e->render.colormod);
-       e->render.entitynumber = e - cl.entities;
+       if(e >= cl.entities && e < cl.entities + cl.num_entities)
+               e->render.entitynumber = e - cl.entities;
+       else
+               e->render.entitynumber = 0;
        if (e->state_current.flags & RENDER_COLORMAPPED)
                CL_SetEntityColormapColors(&e->render, e->state_current.colormap);
        else if (e->state_current.colormap > 0 && e->state_current.colormap <= cl.maxclients && cl.scores != NULL)