Browse Source

Set and remove view entity model; this makes the weapon model appear correctly in first-person view

console
Nico de Poel 5 years ago
parent
commit
95a89be509
  1. 17
      engine/Quake/gl_rmain.c

17
engine/Quake/gl_rmain.c

@ -667,21 +667,36 @@ R_DrawViewModel -- johnfitz -- gutted
*/
void R_DrawViewModel (void)
{
currententity = &cl.viewent;
if (!r_drawviewmodel.value || !r_drawentities.value || chase_active.value)
{
UQ_Game_RemoveEntity(currententity->num);
return;
}
if (cl.items & IT_INVISIBILITY || cl.stats[STAT_HEALTH] <= 0)
{
UQ_Game_RemoveEntity(currententity->num);
return;
}
currententity = &cl.viewent;
if (!currententity->model)
{
UQ_Game_RemoveEntity(currententity->num);
return;
}
//johnfitz -- this fixes a crash
if (currententity->model->type != mod_alias)
{
UQ_Game_RemoveEntity(currententity->num);
return;
}
//johnfitz
UQ_Game_SetEntityModel(currententity->num, currententity->model->name);
// hack the depth range to prevent view model from poking into walls
glDepthRange (0, 0.3);
R_DrawAliasModel (currententity);

Loading…
Cancel
Save