mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +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)
|
R_DrawViewModel (void)
|
||||||
{
|
{
|
||||||
entity_t ent = vr_data.view_model;
|
entity_t ent = vr_data.view_model;
|
||||||
|
if (!Entity_Valid (ent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||||
if (vr_data.inhibit_viewmodel
|
if (vr_data.inhibit_viewmodel
|
||||||
|| !r_drawviewmodel
|
|| !r_drawviewmodel
|
||||||
|
|
|
@ -116,6 +116,9 @@ static void
|
||||||
R_DrawViewModel (void)
|
R_DrawViewModel (void)
|
||||||
{
|
{
|
||||||
entity_t ent = vr_data.view_model;
|
entity_t ent = vr_data.view_model;
|
||||||
|
if (!Entity_Valid (ent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||||
if (vr_data.inhibit_viewmodel
|
if (vr_data.inhibit_viewmodel
|
||||||
|| !r_drawviewmodel
|
|| !r_drawviewmodel
|
||||||
|
|
|
@ -377,6 +377,9 @@ R_DrawViewModel (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
viewent = vr_data.view_model;
|
viewent = vr_data.view_model;
|
||||||
|
if (!Entity_Valid (viewent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
renderer_t *renderer = Ent_GetComponent (viewent.id, scene_renderer,
|
renderer_t *renderer = Ent_GetComponent (viewent.id, scene_renderer,
|
||||||
viewent.reg);
|
viewent.reg);
|
||||||
|
|
|
@ -108,6 +108,9 @@ static void
|
||||||
Vulkan_DrawViewModel (vulkan_ctx_t *ctx)
|
Vulkan_DrawViewModel (vulkan_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
entity_t ent = vr_data.view_model;
|
entity_t ent = vr_data.view_model;
|
||||||
|
if (!Entity_Valid (ent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
renderer_t *renderer = Ent_GetComponent (ent.id, scene_renderer, ent.reg);
|
||||||
if (vr_data.inhibit_viewmodel
|
if (vr_data.inhibit_viewmodel
|
||||||
|| !r_drawviewmodel
|
|| !r_drawviewmodel
|
||||||
|
|
Loading…
Reference in a new issue