mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Fix default trace model allocation and refcount following restore from save file
This commit is contained in:
parent
36f42a949e
commit
2139416e43
1 changed files with 6 additions and 1 deletions
|
@ -80,6 +80,8 @@ static idHashIndex traceModelHash;
|
|||
static idHashIndex traceModelHash_Unsaved;
|
||||
const static int TRACE_MODEL_SAVED = BIT( 16 );
|
||||
|
||||
// SRS - statically define the default trace model used for the default clip model
|
||||
const static idTraceModel defaultTraceModel = idBounds( idVec3( 0, 0, 0 ) ).Expand( 8 );
|
||||
|
||||
/*
|
||||
===============
|
||||
|
@ -305,6 +307,9 @@ void idClipModel::RestoreTraceModels( idRestoreGame* savefile )
|
|||
traceModelCache[i] = entry;
|
||||
traceModelHash.Add( GetTraceModelHashKey( entry->trm ), i );
|
||||
}
|
||||
|
||||
// SRS - find or allocate default trace model here since it's not referenced by objects
|
||||
gameLocal.clip.DefaultClipModel()->traceModelIndex = AllocTraceModel( defaultTraceModel );
|
||||
}
|
||||
|
||||
|
||||
|
@ -900,7 +905,7 @@ void idClip::Init()
|
|||
gameLocal.Printf( "max clip sector is (%1.1f, %1.1f, %1.1f)\n", maxSector[0], maxSector[1], maxSector[2] );
|
||||
|
||||
// initialize a default clip model
|
||||
defaultClipModel.LoadModel( idTraceModel( idBounds( idVec3( 0, 0, 0 ) ).Expand( 8 ) ) );
|
||||
defaultClipModel.LoadModel( defaultTraceModel );
|
||||
|
||||
// set counters to zero
|
||||
numRotations = numTranslations = numMotions = numRenderModelTraces = numContents = numContacts = 0;
|
||||
|
|
Loading…
Reference in a new issue