mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-11 07:42:18 +00:00
[renderer] Check view_model entity is valid
It usually is in quake, but my test scene does not have a view model.
This commit is contained in:
parent
fa057cb121
commit
c605e50d52
4 changed files with 12 additions and 0 deletions
|
@ -160,6 +160,9 @@ static void
|
|||
R_DrawViewModel (void)
|
||||
{
|
||||
entity_t ent = vr_data.view_model;
|
||||
if (!Entity_Valid (ent)) {
|
||||
return;
|
||||
}
|
||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel
|
||||
|
|
|
@ -116,6 +116,9 @@ static void
|
|||
R_DrawViewModel (void)
|
||||
{
|
||||
entity_t ent = vr_data.view_model;
|
||||
if (!Entity_Valid (ent)) {
|
||||
return;
|
||||
}
|
||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel
|
||||
|
|
|
@ -377,6 +377,9 @@ R_DrawViewModel (void)
|
|||
return;
|
||||
|
||||
viewent = vr_data.view_model;
|
||||
if (!Entity_Valid (viewent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
renderer_t *renderer = Ent_GetComponent (viewent.id, scene_renderer,
|
||||
viewent.reg);
|
||||
|
|
|
@ -108,6 +108,9 @@ static void
|
|||
Vulkan_DrawViewModel (vulkan_ctx_t *ctx)
|
||||
{
|
||||
entity_t ent = vr_data.view_model;
|
||||
if (!Entity_Valid (ent)) {
|
||||
return;
|
||||
}
|
||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel
|
||||
|
|
Loading…
Reference in a new issue