ref_soft: Fix R_NewMap, prevent crashes on changelevel/restart
This commit is contained in:
parent
e0cd5edddb
commit
cefe42fd66
2 changed files with 39 additions and 32 deletions
|
@ -1173,7 +1173,7 @@ int R_CreateDecalList( decallist_t *pList )
|
|||
int total = 0;
|
||||
int i, depth;
|
||||
|
||||
return 0; // crash on changelevel. API bug?
|
||||
// return 0; // crash on changelevel. API bug?
|
||||
|
||||
if( WORLDMODEL )
|
||||
{
|
||||
|
|
7
r_main.c
7
r_main.c
|
@ -1822,7 +1822,10 @@ R_NewMap
|
|||
*/
|
||||
void R_NewMap (void)
|
||||
{
|
||||
int i;
|
||||
r_viewcluster = -1;
|
||||
R_ClearDecals(); // clear all level decals
|
||||
R_StudioResetPlayerModels();
|
||||
|
||||
D_FlushCaches( true );
|
||||
|
||||
|
@ -1860,6 +1863,10 @@ void R_NewMap (void)
|
|||
{
|
||||
auxedges = malloc (r_numallocatededges * sizeof(edge_t));
|
||||
}
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
for( i = 0; i < WORLDMODEL->numleafs; i++ )
|
||||
WORLDMODEL->leafs[i+1].efrags = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue