Closed jordanbriere closed 2 years ago
Just to clarify; if CCollisionManager::ShouldHitEntity
is called, then that means the game allows the collision. If a CollisionHook
(that is always called, regardless of the cache) prevent the collision then the cache for the current tick is updated. If the original m_pExtraShouldHitCheckFunction
function prevents the collision, regardless of the cache, the cache is not updated and this decision takes precedence over any CollisionHash
/OnEntityCollision
/OnPlayerCollision
callbacks. Basically, the cache is only used to limit CollisionHash
lookups, as well as python calls to the listeners, and should not affect anything else beside being a major improvement because the game usually does one trace, then a dozen leaves/sweeps checks on the same test and this is what we no longer have to process.
I'll leave this for the record and warning, CollisionHash
will cause a crash if you add more than 256 entity combinations.
You should STOP using EntityIter or similar methods to add entities to CollisionHash.
See the comments for more details. https://github.com/Source-Python-Dev-Team/Source.Python/pull/444#issuecomment-989106572 https://github.com/Source-Python-Dev-Team/Source.Python/pull/444#issuecomment-989234996