Fix an issue with the new hitboxcache

This commit is contained in:
BenCat07 2020-05-30 15:28:04 +02:00
parent 9be6c8e6cd
commit bc3887d75a

View File

@ -7,6 +7,7 @@
#include <settings/Int.hpp>
#include "common.hpp"
#include "MiscTemporary.hpp"
namespace hitbox_cache
{
@ -127,10 +128,12 @@ matrix3x4_t *EntityHitboxCache::GetBones(int numbones)
if (!bones_setup)
{
// Reset game cache
if (!bonecache_enabled)
if (!bonecache_enabled && CE_GOOD(parent_ref))
{
re::C_BaseAnimating::InvalidateBoneCache(RAW_ENT(parent_ref));
re::C_BaseAnimating::Interpolate(RAW_ENT(parent_ref), bones_setup_time);
// Only use when nolerp is on as this breaks game visuals a tad
if (nolerp)
re::C_BaseAnimating::Interpolate(RAW_ENT(parent_ref), bones_setup_time);
}
// If numbones is not set, get it from some terrible and unnamed variable