mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Revisited aggressive object freeing
This commit is contained in:
parent
ed397348d1
commit
c1ad23ed22
1 changed files with 4 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
|||
#include "ModelInfoSA.h"
|
||||
#include "PoolsSA.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
// Wrappers
|
||||
static void* EntityRender = AddressByVersion<void*>(0x534310, 0x5347B0, 0x545B30);
|
||||
WRAPPER void CEntity::Render() { VARJMP(EntityRender); }
|
||||
|
@ -105,9 +107,9 @@ extern void (*WorldRemove)(CEntity*);
|
|||
void CObject::TryToFreeUpTempObjects_SilentPatch( int numObjects )
|
||||
{
|
||||
const auto [ numProcessed, numFreed ] = TryOrFreeUpTempObjects( numObjects, false );
|
||||
if ( numProcessed >= numObjects && numObjects > numFreed )
|
||||
if ( numFreed < numObjects )
|
||||
{
|
||||
TryOrFreeUpTempObjects( numObjects - numFreed, true );
|
||||
TryOrFreeUpTempObjects( std::min(numProcessed, numObjects - numFreed), true );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue