Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do more checks before flagging a model to be lit #206

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Check there is a model.
  • Loading branch information
hemebond committed Sep 25, 2024
commit bef6b17e10b74e781e4829ececa1cdc038b27a33
6 changes: 3 additions & 3 deletions cl_main.c
Original file line number Diff line number Diff line change
@@ -1306,7 +1306,7 @@ static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qbool interp
if (e->state_current.number == cl.viewentity)
e->render.flags |= RENDER_EXTERIORMODEL;
// either fullbright or lit
if(!r_fullbright.integer && e->render.model->lit)
if(!r_fullbright.integer && (e->render.model && e->render.model->lit))
{
if (!(e->render.effects & EF_FULLBRIGHT))
e->render.flags |= RENDER_LIGHT;
@@ -1720,7 +1720,7 @@ static void CL_RelinkWorld(void)
// FIXME: this should be done at load
ent->render.matrix = identitymatrix;
ent->render.flags = RENDER_SHADOW;
if (!r_fullbright.integer && ent->render.model->lit)
if (!r_fullbright.integer && (ent->render.model && ent->render.model->lit))
ent->render.flags |= RENDER_LIGHT;
VectorSet(ent->render.colormod, 1, 1, 1);
VectorSet(ent->render.glowmod, 1, 1, 1);
@@ -1745,7 +1745,7 @@ static void CL_RelinkStaticEntities(void)
// need to re-fetch the model pointer
e->render.model = CL_GetModelByIndex(e->state_baseline.modelindex);
// either fullbright or lit
if(!r_fullbright.integer && e->render.model->lit)
if(!r_fullbright.integer && (e->render.model && e->render.model->lit))
{
if (!(e->render.effects & EF_FULLBRIGHT))
e->render.flags |= RENDER_LIGHT;
Loading
Oops, something went wrong.