ref: when entity model is NULL, the entity is player and we're drawing in menu, skip this entity silently

The menu relies on the fact that model is set from player's userinfo, and if it has bogus model, it will
trip on the nullptr model assert
This commit is contained in:
Alibek Omarov
2026-05-26 02:56:36 +05:00
parent e01921dd10
commit e87b14468d
2 changed files with 18 additions and 0 deletions

View File

@@ -805,6 +805,9 @@ static void R_DrawEntitiesOnList( void )
RI.currententity = tr.draw_list->solid_entities[i];
RI.currentmodel = RI.currententity->model;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );
@@ -837,6 +840,9 @@ static void R_DrawEntitiesOnList( void )
RI.currententity = tr.draw_list->solid_entities[i];
RI.currentmodel = RI.currententity->model;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );
@@ -875,6 +881,9 @@ static void R_DrawEntitiesOnList( void )
if( tr.blend <= 0.0f ) continue;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );

View File

@@ -517,6 +517,9 @@ static void R_DrawEntitiesOnList( void )
RI.currentmodel = RI.currententity->model;
// d_aflatcolor += 500;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );
@@ -544,6 +547,9 @@ static void R_DrawEntitiesOnList( void )
RI.currententity = tr.draw_list->solid_entities[i];
RI.currentmodel = RI.currententity->model;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );
@@ -579,6 +585,9 @@ static void R_DrawEntitiesOnList( void )
if( tr.blend <= 0.0f )
continue;
if( !RI.currentmodel && RI.currententity->player && !FBitSet( RI.rvp.flags, RF_DRAW_WORLD ))
continue;
Assert( RI.currententity != NULL );
Assert( RI.currentmodel != NULL );