diff options
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r-- | src/cgame/cg_buildable.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 2c85bfd7..33a3cc0e 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -1321,7 +1321,9 @@ void CG_Buildable( centity_t *cent ) // seeing as buildables rarely move, we cache the results and recalculate // only if the buildable moves or changes orientation if( VectorCompare( cent->buildableCache.cachedOrigin, cent->lerpOrigin ) && - VectorCompare( cent->buildableCache.cachedNormal, surfNormal ) ) + VectorCompare( cent->buildableCache.cachedAngles, cent->lerpAngles ) && + VectorCompare( cent->buildableCache.cachedNormal, surfNormal ) && + cent->buildableCache.cachedType == es->modelindex ) { VectorCopy( cent->buildableCache.axis[ 0 ], ent.axis[ 0 ] ); VectorCopy( cent->buildableCache.axis[ 1 ], ent.axis[ 1 ] ); @@ -1338,7 +1340,9 @@ void CG_Buildable( centity_t *cent ) VectorCopy( ent.axis[ 2 ], cent->buildableCache.axis[ 2 ] ); VectorCopy( ent.origin, cent->buildableCache.origin ); VectorCopy( cent->lerpOrigin, cent->buildableCache.cachedOrigin ); + VectorCopy( cent->lerpAngles, cent->buildableCache.cachedAngles ); VectorCopy( surfNormal, cent->buildableCache.cachedNormal ); + cent->buildableCache.cachedType = es->modelindex; } } else |