mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-11 07:42:18 +00:00
[sw] Ensure the view model has a visibility component
The rest of the system won't add one automatically (since entity creation no longer does), but the alias and iqm rendering code expect there to be one. Fixes a segfault when starting a scene (demo etc).
This commit is contained in:
parent
b59505b7c1
commit
2a8c12426d
1 changed files with 7 additions and 0 deletions
|
@ -386,6 +386,13 @@ R_DrawViewModel (void)
|
|||
if (!renderer->model)
|
||||
return;
|
||||
|
||||
if (!Ent_HasComponent (viewent.id, scene_visibility, viewent.reg)) {
|
||||
// ensure the view model has a visibility component because one won't
|
||||
// be added automatically, and the model rendering code expects there
|
||||
// to be one
|
||||
Ent_SetComponent (viewent.id, scene_visibility, viewent.reg, 0);
|
||||
}
|
||||
|
||||
transform_t transform = Entity_Transform (viewent);
|
||||
VectorCopy (Transform_GetWorldPosition (transform), r_entorigin);
|
||||
|
||||
|
|
Loading…
Reference in a new issue