Skip to content

Commit

Permalink
Fix debug issues in memoverride.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
GAMMACASE committed Oct 20, 2023
1 parent f653b1e commit 8e69335
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entity2/entitysystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CBaseEntity* CEntitySystem::GetBaseEntity(CEntityIndex entnum)
if (!pIdentity)
return nullptr;

if (pIdentity->m_EHandle.GetEntryIndex() != entnum.Get())
if (pIdentity->GetEntityIndex() != entnum)
return nullptr;

return static_cast<CBaseEntity*>(pIdentity->m_pInstance);
Expand All @@ -33,7 +33,7 @@ CBaseEntity* CEntitySystem::GetBaseEntity(const CEntityHandle& hEnt)
if (!pIdentity)
return nullptr;

if (pIdentity->m_EHandle != hEnt)
if (pIdentity->GetRefEHandle() != hEnt)
return nullptr;

return static_cast<CBaseEntity*>(pIdentity->m_pInstance);
Expand Down
7 changes: 7 additions & 0 deletions public/tier0/memoverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,12 @@ class CAttibCRT
};


#ifdef PREVENT_DEBUG_USAGE
#define AttribIfCrt()
#else
#define AttribIfCrt() CAttibCRT _attrib(nBlockUse)
#endif

#elif defined(POSIX)
#define AttribIfCrt()
#endif // _WIN32
Expand Down Expand Up @@ -976,11 +981,13 @@ void __cdecl _aligned_free_dbg( void * memblock)
_aligned_free(memblock);
}

#if 0
size_t __cdecl _CrtSetDebugFillThreshold( size_t _NewDebugFillThreshold)
{
Assert(0);
return 0;
}
#endif

//===========================================
// NEW!!! 64-bit
Expand Down

0 comments on commit 8e69335

Please sign in to comment.